aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 406f4df16f..f1b03ff9c7 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/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;