File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -2444,20 +2444,14 @@ bool VarDecl::hasInitWithSideEffects() const {
2444
2444
if (!hasInit ())
2445
2445
return false ;
2446
2446
2447
- // Check if we can get the initializer without deserializing
2448
- const Expr *E = nullptr ;
2447
+ // Check if we can get the initializer directly without an external source
2449
2448
if (auto *S = dyn_cast<Stmt *>(Init)) {
2450
- E = cast<Expr>(S);
2451
- } else {
2452
- E = cast_or_null<Expr>(getEvaluatedStmt ()->Value .getWithoutDeserializing ());
2453
- }
2454
-
2455
- if (E)
2449
+ const Expr *E = cast<Expr>(S);
2456
2450
return E->HasSideEffects (getASTContext ()) &&
2457
2451
// We can get a value-dependent initializer during error recovery.
2458
2452
(E->isValueDependent () || !evaluateValue ());
2453
+ }
2459
2454
2460
- assert (getEvaluatedStmt ()->Value .isOffset ());
2461
2455
// ASTReader tracks this without having to deserialize the initializer
2462
2456
if (auto Source = getASTContext ().getExternalSource ())
2463
2457
return Source->hasInitializerWithSideEffects (this );
You can’t perform that action at this time.
0 commit comments