File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -2473,17 +2473,6 @@ bool ByteCodeExprGen<Emitter>::dereferenceVar(
2473
2473
}
2474
2474
}
2475
2475
2476
- // If the declaration is a constant value, emit it here even
2477
- // though the declaration was not evaluated in the current scope.
2478
- // The access mode can only be read in this case.
2479
- if (!DiscardResult && AK == DerefKind::Read) {
2480
- if (VD->hasLocalStorage () && VD->hasInit () && !VD->isConstexpr ()) {
2481
- QualType VT = VD->getType ();
2482
- if (VT.isConstQualified () && VT->isFundamentalType ())
2483
- return this ->visit (VD->getInit ());
2484
- }
2485
- }
2486
-
2487
2476
// Value cannot be produced - try to emit pointer.
2488
2477
return visit (LV) && Indirect (T);
2489
2478
}
Original file line number Diff line number Diff line change @@ -543,3 +543,12 @@ namespace StaticLocals {
543
543
static_assert (m == 0 , " " );
544
544
}
545
545
}
546
+
547
+ namespace Local {
548
+ // / We used to run into infinite recursin here because we were
549
+ // / trying to evaluate t's initializer while evaluating t's initializer.
550
+ int a () {
551
+ const int t=t;
552
+ return t;
553
+ }
554
+ }
You can’t perform that action at this time.
0 commit comments