Skip to content

Commit 641a257

Browse files
committed
Sema: Don't diagnose forward references to debugger variables in pre-checking
1 parent 9e4bdb6 commit 641a257

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Sema/PreCheckExpr.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ Expr *TypeChecker::resolveDeclRefExpr(UnresolvedDeclRefExpr *UDRE,
380380

381381
ValueDecl *localDeclAfterUse = nullptr;
382382
auto isValid = [&](ValueDecl *D) {
383+
// References to variables injected by lldb are always valid.
384+
if (isa<VarDecl>(D) && cast<VarDecl>(D)->isDebuggerVar())
385+
return true;
386+
383387
// If we find something in the current context, it must be a forward
384388
// reference, because otherwise if it was in scope, it would have
385389
// been returned by the call to ASTScope::lookupLocalDecls() above.

0 commit comments

Comments
 (0)