summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-12-24 21:56:24 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-12-24 21:56:24 +0000
commit966c1fb0c8e88e1806a38118b03e805e2ab4ff2d (patch)
tree785e0c195152a535b56c3eb1b4110f2132df2063 /clang/lib
parentb16bd77bd239829b9010bb186623183613beeb1d (diff)
downloadbcm5719-llvm-966c1fb0c8e88e1806a38118b03e805e2ab4ff2d.tar.gz
bcm5719-llvm-966c1fb0c8e88e1806a38118b03e805e2ab4ff2d.zip
Always implicitly declare move assignment operations for dynamic classes, in
case they override virtual functions from a base class. Also fix -print-stats counting of move assignment/construction. llvm-svn: 147258
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 7f743f50f38..ad327ac755e 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -4981,6 +4981,9 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
if (!ClassDecl->hasUserDeclaredCopyConstructor())
++ASTContext::NumImplicitCopyConstructors;
+ if (getLangOptions().CPlusPlus0x && ClassDecl->needsImplicitMoveConstructor())
+ ++ASTContext::NumImplicitMoveConstructors;
+
if (!ClassDecl->hasUserDeclaredCopyAssignment()) {
++ASTContext::NumImplicitCopyAssignmentOperators;
@@ -4992,6 +4995,14 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
DeclareImplicitCopyAssignment(ClassDecl);
}
+ if (getLangOptions().CPlusPlus0x && ClassDecl->needsImplicitMoveAssignment()){
+ ++ASTContext::NumImplicitMoveAssignmentOperators;
+
+ // Likewise for the move assignment operator.
+ if (ClassDecl->isDynamicClass())
+ DeclareImplicitMoveAssignment(ClassDecl);
+ }
+
if (!ClassDecl->hasUserDeclaredDestructor()) {
++ASTContext::NumImplicitDestructors;
OpenPOWER on IntegriCloud