mirror of
https://github.com/intel/llvm.git
synced 2026-02-02 02:00:03 +08:00
Actually store the pointer into the global variable, spotted by Eli.
llvm-svn: 91036
This commit is contained in:
@@ -193,10 +193,13 @@ CodeGenFunction::EmitStaticCXXBlockVarDeclInit(const VarDecl &D,
|
||||
EmitBlock(InitBlock);
|
||||
|
||||
if (D.getType()->isReferenceType()) {
|
||||
QualType T = D.getType();
|
||||
// We don't want to pass true for IsInitializer here, because a static
|
||||
// reference to a temporary does not extend its lifetime.
|
||||
EmitReferenceBindingToExpr(D.getInit(), D.getType(),
|
||||
/*IsInitializer=*/false);
|
||||
RValue RV = EmitReferenceBindingToExpr(D.getInit(), T,
|
||||
/*IsInitializer=*/false);
|
||||
EmitStoreOfScalar(RV.getScalarVal(), GV, /*Volatile=*/false, T);
|
||||
|
||||
} else
|
||||
EmitDeclInit(*this, D, GV);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user