diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-13 18:48:05 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-13 18:48:05 +0000 |
| commit | a87b766027322ef8e2fed8843aad5df67a9ecf68 (patch) | |
| tree | 0d8427ef53eb001c4a596c9c67b1b4f283e60ae2 /clang/lib/Sema/SemaDeclCXX.cpp | |
| parent | be11bdc4b06ad634442016fce4e13a426ef9caa5 (diff) | |
| download | bcm5719-llvm-a87b766027322ef8e2fed8843aad5df67a9ecf68.tar.gz bcm5719-llvm-a87b766027322ef8e2fed8843aad5df67a9ecf68.zip | |
Use marginally more appropriate functions to detect if we should declare an
implicit copy constructor/assignment, and other minor cleanups. No
functionality change intended.
llvm-svn: 269457
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 96c47e29ef3..ee81bbc2872 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -6463,7 +6463,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { ClassDecl->hasInheritedConstructor()) DeclareImplicitDefaultConstructor(ClassDecl); - if (!ClassDecl->hasUserDeclaredCopyConstructor()) { + if (ClassDecl->needsImplicitCopyConstructor()) { ++ASTContext::NumImplicitCopyConstructors; // If the properties or semantics of the copy constructor couldn't be @@ -6482,7 +6482,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { DeclareImplicitMoveConstructor(ClassDecl); } - if (!ClassDecl->hasUserDeclaredCopyAssignment()) { + if (ClassDecl->needsImplicitCopyAssignment()) { ++ASTContext::NumImplicitCopyAssignmentOperators; // If we have a dynamic class, then the copy assignment operator may be @@ -6505,7 +6505,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { DeclareImplicitMoveAssignment(ClassDecl); } - if (!ClassDecl->hasUserDeclaredDestructor()) { + if (ClassDecl->needsImplicitDestructor()) { ++ASTContext::NumImplicitDestructors; // If we have a dynamic class, then the destructor may be virtual, so we @@ -8946,6 +8946,7 @@ void Sema::CheckImplicitSpecialMemberDeclaration(Scope *S, FunctionDecl *FD) { if (auto *Acceptable = R.getAcceptableDecl(D)) R.addDecl(Acceptable); R.resolveKind(); + R.suppressDiagnostics(); CheckFunctionDeclaration(S, FD, R, /*IsExplicitSpecialization*/false); } |

