diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-26 07:51:39 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-26 07:51:39 +0000 |
commit | 03f68788036803c0bad3fe6ea9a4ea31ba195a2b (patch) | |
tree | 5bf9de306960c6c370fc0126161a19fb6db3dcd9 /lib/Sema/SemaExpr.cpp | |
parent | 88189556c5d620f2c46ea5599b95456b4da138b5 (diff) |
Make sure we don't try to produce a definition of an implicitly-deleted function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 5d6f5ef7f4..10ae8f4bad 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -9420,7 +9420,7 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func) { // Note that this declaration has been used. if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(Func)) { - if (Constructor->isDefaulted()) { + if (Constructor->isDefaulted() && !Constructor->isDeleted()) { if (Constructor->isDefaultConstructor()) { if (Constructor->isTrivial()) return; @@ -9438,12 +9438,14 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func) { MarkVTableUsed(Loc, Constructor->getParent()); } else if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(Func)) { - if (Destructor->isDefaulted() && !Destructor->isUsed(false)) + if (Destructor->isDefaulted() && !Destructor->isDeleted() && + !Destructor->isUsed(false)) DefineImplicitDestructor(Loc, Destructor); if (Destructor->isVirtual()) MarkVTableUsed(Loc, Destructor->getParent()); } else if (CXXMethodDecl *MethodDecl = dyn_cast<CXXMethodDecl>(Func)) { - if (MethodDecl->isDefaulted() && MethodDecl->isOverloadedOperator() && + if (MethodDecl->isDefaulted() && !MethodDecl->isDeleted() && + MethodDecl->isOverloadedOperator() && MethodDecl->getOverloadedOperator() == OO_Equal) { if (!MethodDecl->isUsed(false)) { if (MethodDecl->isCopyAssignmentOperator()) |