================
@@ -1570,6 +1564,12 @@ class Sema final : public SemaBase {
Sema(const Sema &) = delete;
void operator=(const Sema &) = delete;
+ /// Tracks condition variables declared in `if` statements,
+ /// mapping each VarDecl to the `Scope*` where it was created.
+ /// Used to detect references to these variables outside their
+ /// lifetime (e.g. in the `else` branch or after the `if`).
+ llvm::DenseMap<const VarDecl*, Scope*> IfScopeVars;
----------------
erichkeane wrote:
This shouldn't live in Sema, the Scope itself should have a reference to the
var.
https://github.com/llvm/llvm-project/pull/156436
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits