CXX [qoi]. Prevent a crash when initializer expression is
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Jan 2015 22:08:10 +0000 (22:08 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Jan 2015 22:08:10 +0000 (22:08 +0000)
invalid when trying to create temporary copy of the invalid
initializer. rdar://19109967

llvm-svn: 227378

clang/lib/Sema/SemaInit.cpp

index c6d9a54..0897467 100644 (file)
@@ -5063,6 +5063,8 @@ static ExprResult CopyObject(Sema &S,
                              const InitializedEntity &Entity,
                              ExprResult CurInit,
                              bool IsExtraneousCopy) {
+  if (CurInit.isInvalid())
+    return CurInit;
   // Determine which class type we're copying to.
   Expr *CurInitExpr = (Expr *)CurInit.get();
   CXXRecordDecl *Class = nullptr;