summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-05-18 01:06:45 +0000
committerAlexis Hunt <alercah@gmail.com>2011-05-18 01:06:45 +0000
commit2430a6fb91febf0b75fda98566dc6c4a67f7ecd5 (patch)
treecb2990fb9516608eea9528b90fe12e1c768c65ea /clang/lib
parentc2bf9e185179941f70739de9278c4c82cfebbe58 (diff)
downloadbcm5719-llvm-2430a6fb91febf0b75fda98566dc6c4a67f7ecd5.tar.gz
bcm5719-llvm-2430a6fb91febf0b75fda98566dc6c4a67f7ecd5.zip
Force declaration of implicit members in C++0x mode.
I hear at least one person crying out in anguish, but it's unfortunately necessary to avoid infinite loops with mutually dependent constructors trying to call each other and determine if they are deleted. It might be possible to go back to the old behavior if we can implement part-of-file lookups efficiently, or if a solution is discovered by which we can safely detect and avoid infinite recusion. llvm-svn: 131515
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 406f4df16f7..f1b03ff9c73 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -2997,6 +2997,12 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) {
// have inherited constructors.
DeclareInheritedConstructors(Record);
+ // Unfortunately, in C++0x mode, we additionally have to declare all
+ // implicit members in order to ensure we don't get a horrible evil bad
+ // infinite recursion from ShouldDelete*
+ if (getLangOptions().CPlusPlus0x)
+ ForceDeclarationOfImplicitMembers(Record);
+
CheckExplicitlyDefaultedMethods(Record);
}
@@ -3454,8 +3460,10 @@ bool Sema::ShouldDeleteDefaultConstructor(CXXConstructorDecl *CD) {
}
bool Sema::ShouldDeleteCopyConstructor(CXXConstructorDecl *CD) {
- CXXRecordDecl *RD = CD->getParent();
+ CXXRecordDecl *RD = CD->getParent()->getDefinition();
assert(!RD->isDependentType() && "do deletion after instantiation");
+ assert(RD);
+ assert(CD->getParent() == RD);
if (!LangOpts.CPlusPlus0x)
return false;
OpenPOWER on IntegriCloud