]> granicus.if.org Git - clang/commitdiff
Bail out of MaybeBindToTemporary if the record type is invalid. Test case
authorJohn McCall <rjmccall@apple.com>
Thu, 12 Aug 2010 02:40:37 +0000 (02:40 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 12 Aug 2010 02:40:37 +0000 (02:40 +0000)
is 8.5MB, sorry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110901 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprCXX.cpp

index 14f4cd10e7ff0f7ddba60cc59893a9d6ddcc3985..5e43574e009f671139227eee4f68abe48dc497be 100644 (file)
@@ -2619,7 +2619,7 @@ Sema::OwningExprResult Sema::MaybeBindToTemporary(Expr *E) {
   // That should be enough to guarantee that this type is complete.
   // If it has a trivial destructor, we can avoid the extra copy.
   CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
-  if (RD->hasTrivialDestructor())
+  if (RD->isInvalidDecl() || RD->hasTrivialDestructor())
     return Owned(E);
 
   CXXTemporary *Temp = CXXTemporary::Create(Context, LookupDestructor(RD));