Integrated a check into Clang that make sure that

it doesn't try to call LookupDestructor on an
incomplete class.

llvm-svn: 157199
This commit is contained in:
Sean Callanan 2012-05-21 17:54:55 +00:00
parent 937bcb2de6
commit 66ad3bcb16
1 changed files with 18 additions and 0 deletions

View File

@ -814,6 +814,24 @@ Index: lib/Sema/SemaExprCXX.cpp
} else if (ObjCArrayLiteral *ArrayLit = dyn_cast<ObjCArrayLiteral>(E)) {
D = ArrayLit->getArrayWithObjectsMethod();
} else if (ObjCDictionaryLiteral *DictLit
@@ -4529,6 +4529,17 @@
if (RD->isInvalidDecl() || RD->isDependentContext())
return Owned(E);
+ if (!RD->getDefinition()) {
+ if (RD->hasExternalLexicalStorage()) {
+ ExternalASTSource *ext_source = RD->getASTContext().getExternalSource();
+ if (ext_source)
+ ext_source->CompleteType(RD);
+ }
+ }
+
+ if (!RD->getDefinition())
+ return Owned(E);
+
bool IsDecltype = ExprEvalContexts.back().IsDecltype;
CXXDestructorDecl *Destructor = IsDecltype ? 0 : LookupDestructor(RD);
Index: lib/Sema/SemaExceptionSpec.cpp
===================================================================
--- lib/Sema/SemaExceptionSpec.cpp (revision 152265)