From e6c32e6293adaff31d8fb436858459e53764332a Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Sun, 19 Feb 2012 14:53:49 +0000 Subject: Refuse to compile global std::initializer_lists instead of doing completely the wrong thing. llvm-svn: 150928 --- clang/lib/CodeGen/CGExprConstant.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/CodeGen/CGExprConstant.cpp') diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index 985e53227e7..a7cd36862ba 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -339,6 +339,11 @@ void ConstStructBuilder::ConvertStructToPacked() { } bool ConstStructBuilder::Build(InitListExpr *ILE) { + if (ILE->initializesStdInitializerList()) { + CGM.ErrorUnsupported(ILE, "global std::initializer_list"); + return false; + } + RecordDecl *RD = ILE->getType()->getAs()->getDecl(); const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD); -- cgit v1.2.3