Remove incorrect assertion.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 3 Jun 2014 08:40:27 +0000 (08:40 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 3 Jun 2014 08:40:27 +0000 (08:40 +0000)
llvm-svn: 210092

clang/lib/CodeGen/CGExprAgg.cpp
clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp

index 760e6f1..4cb81b5 100644 (file)
@@ -439,10 +439,9 @@ void AggExprEmitter::EmitArrayInit(llvm::Value *DestPtr, llvm::ArrayType *AType,
   // type is an array (or array of array, etc.) of class type.
   Expr *filler = E->getArrayFiller();
   bool hasTrivialFiller = true;
-  if (CXXConstructExpr *cons = dyn_cast_or_null<CXXConstructExpr>(filler)) {
-    assert(cons->getConstructor()->isDefaultConstructor());
-    hasTrivialFiller = cons->getConstructor()->isTrivial();
-  }
+  if (CXXConstructExpr *cons = dyn_cast_or_null<CXXConstructExpr>(filler))
+    hasTrivialFiller = cons->getConstructor()->isDefaultConstructor() &&
+                       cons->getConstructor()->isTrivial();
 
   // Any remaining elements need to be zero-initialized, possibly
   // using the filler expression.  We can skip this if the we're
index 9c8d7f1..33bd844 100644 (file)
@@ -448,3 +448,10 @@ namespace DR1070 {
   };
   C c = {};
 }
+
+namespace ArrayOfInitList {
+  struct S {
+    S(std::initializer_list<int>);
+  };
+  S x[1] = {};
+}