From 3b6bef9a213249c6ab6d67c07b1ac6380961be3e Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 24 Aug 2012 11:54:20 +0000 Subject: Push ArrayRef through the Expr hierarchy. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162552 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 72e3e5c29a..554aa1cb4c 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1469,10 +1469,10 @@ CodeGenModule::MaybeEmitGlobalStdInitializerListInitializer(const VarDecl *D, // Now clone the InitListExpr to initialize the array instead. // Incredible hack: we want to use the existing InitListExpr here, so we need // to tell it that it no longer initializes a std::initializer_list. - Expr *arrayInit = new (ctx) InitListExpr(ctx, init->getLBraceLoc(), - const_cast(init)->getInits(), - init->getNumInits(), - init->getRBraceLoc()); + ArrayRef Inits(const_cast(init)->getInits(), + init->getNumInits()); + Expr *arrayInit = new (ctx) InitListExpr(ctx, init->getLBraceLoc(), Inits, + init->getRBraceLoc()); arrayInit->setType(arrayType); if (!cleanups.empty()) -- cgit v1.2.3-70-g09d2