r269457 - Use marginally more appropriate functions to detect if we should declare an
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Fri May 13 11:48:06 PDT 2016
Author: rsmith
Date: Fri May 13 13:48:05 2016
New Revision: 269457
URL: http://llvm.org/viewvc/llvm-project?rev=269457&view=rev
Log:
Use marginally more appropriate functions to detect if we should declare an
implicit copy constructor/assignment, and other minor cleanups. No
functionality change intended.
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=269457&r1=269456&r2=269457&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri May 13 13:48:05 2016
@@ -6463,7 +6463,7 @@ void Sema::AddImplicitlyDeclaredMembersT
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::AddImplicitlyDeclaredMembersT
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::AddImplicitlyDeclaredMembersT
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::CheckImplicitSpecialMemberDec
if (auto *Acceptable = R.getAcceptableDecl(D))
R.addDecl(Acceptable);
R.resolveKind();
+ R.suppressDiagnostics();
CheckFunctionDeclaration(S, FD, R, /*IsExplicitSpecialization*/false);
}
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=269457&r1=269456&r2=269457&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Fri May 13 13:48:05 2016
@@ -738,11 +738,11 @@ void Sema::ForceDeclarationOfImplicitMem
if (getLangOpts().CPlusPlus11) {
// If the move constructor has not yet been declared, do so now.
if (Class->needsImplicitMoveConstructor())
- DeclareImplicitMoveConstructor(Class); // might not actually do it
+ DeclareImplicitMoveConstructor(Class);
// If the move assignment operator has not yet been declared, do so now.
if (Class->needsImplicitMoveAssignment())
- DeclareImplicitMoveAssignment(Class); // might not actually do it
+ DeclareImplicitMoveAssignment(Class);
}
// If the destructor has not yet been declared, do so now.
More information about the cfe-commits
mailing list