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);
|
EmitBlock(InitBlock);
|
||||||
|
|
||||||
if (D.getType()->isReferenceType()) {
|
if (D.getType()->isReferenceType()) {
|
||||||
|
QualType T = D.getType();
|
||||||
// We don't want to pass true for IsInitializer here, because a static
|
// We don't want to pass true for IsInitializer here, because a static
|
||||||
// reference to a temporary does not extend its lifetime.
|
// reference to a temporary does not extend its lifetime.
|
||||||
EmitReferenceBindingToExpr(D.getInit(), D.getType(),
|
RValue RV = EmitReferenceBindingToExpr(D.getInit(), T,
|
||||||
/*IsInitializer=*/false);
|
/*IsInitializer=*/false);
|
||||||
|
EmitStoreOfScalar(RV.getScalarVal(), GV, /*Volatile=*/false, T);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
EmitDeclInit(*this, D, GV);
|
EmitDeclInit(*this, D, GV);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue