forked from OSchip/llvm-project
Actually store the pointer into the global variable, spotted by Eli.
llvm-svn: 91036
This commit is contained in:
parent
3c6a12ca65
commit
fefc7b8e7b
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue