From 24fe798fffc1748d8bce1321af42981c3719cb85 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150928 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprConstant.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/CodeGen/CGExprConstant.cpp') diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 985e53227e..a7cd36862b 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/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