From 9213a6bfa4dd0d3c7e386ff7208f5e6a9124a5d6 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 3 Jun 2014 08:40:27 +0000 Subject: [PATCH] Remove incorrect assertion. llvm-svn: 210092 --- clang/lib/CodeGen/CGExprAgg.cpp | 7 +++---- clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp | 7 +++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 760e6f1..4cb81b54 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -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(filler)) { - assert(cons->getConstructor()->isDefaultConstructor()); - hasTrivialFiller = cons->getConstructor()->isTrivial(); - } + if (CXXConstructExpr *cons = dyn_cast_or_null(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 diff --git a/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp index 9c8d7f1..33bd844 100644 --- a/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -448,3 +448,10 @@ namespace DR1070 { }; C c = {}; } + +namespace ArrayOfInitList { + struct S { + S(std::initializer_list); + }; + S x[1] = {}; +} -- 2.7.4