Skip to content

Commit 5d99160

Browse files
committed
Use existing Init variable
1 parent c0cee82 commit 5d99160

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/AST/ExprConstant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3600,7 +3600,7 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E,
36003600
VD->mightBeUsableInConstantExpressions(Info.Ctx)) ||
36013601
((Info.getLangOpts().CPlusPlus || Info.getLangOpts().OpenCL) &&
36023602
!Info.getLangOpts().CPlusPlus11 && !VD->hasICEInitializer(Info.Ctx))) {
3603-
if (VD->getAnyInitializer()) {
3603+
if (Init) {
36043604
Info.CCEDiag(E, diag::note_constexpr_var_init_non_constant, 1) << VD;
36053605
NoteLValueLocation(Info, Base);
36063606
} else {

0 commit comments

Comments
 (0)