Skip to content

Commit ad82d1c

Browse files
committed
[clang][Interp][NFC] Move a lambda declaration into its closest scope
1 parent 4f68d20 commit ad82d1c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/lib/AST/Interp/Compiler.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3552,12 +3552,12 @@ VarCreationState Compiler<Emitter>::visitVarDecl(const VarDecl *VD, bool Topleve
35523552
const Expr *Init = VD->getInit();
35533553
std::optional<PrimType> VarT = classify(VD->getType());
35543554

3555-
auto checkDecl = [&]() -> bool {
3556-
bool NeedsOp = !Toplevel && VD->isLocalVarDecl() && VD->isStaticLocal();
3557-
return !NeedsOp || this->emitCheckDecl(VD, VD);
3558-
};
3559-
35603555
if (Context::shouldBeGloballyIndexed(VD)) {
3556+
auto checkDecl = [&]() -> bool {
3557+
bool NeedsOp = !Toplevel && VD->isLocalVarDecl() && VD->isStaticLocal();
3558+
return !NeedsOp || this->emitCheckDecl(VD, VD);
3559+
};
3560+
35613561
auto initGlobal = [&](unsigned GlobalIndex) -> bool {
35623562
assert(Init);
35633563
DeclScope<Emitter> LocalScope(this, VD);

0 commit comments

Comments
 (0)