Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com>, Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com>, Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com>, Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com>, Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com>, Stefan =?utf-8?q?Gränitz?= <stefan.graen...@gmail.com> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/84...@github.com>
================ @@ -5676,24 +5676,32 @@ Parser::DeclGroupPtrTy Parser::ParseTopLevelStmtDecl() { // Parse a top-level-stmt. Parser::StmtVector Stmts; ParsedStmtContext SubStmtCtx = ParsedStmtContext(); - Actions.PushFunctionScope(); + ParseScope FnScope(this, Scope::FnScope | Scope::DeclScope | ---------------- vgvassilev wrote: It's a bit awkward to push scoping state in two places. I am wondering if moving the `FnScope` down in `ActOnStartTopLevelStmtDecl` and `ActOnFinishTopLevelStmtDecl` would be a good idea. It would make the implementation look cleaner but if an error occurs the state of the scopes will be inconsistent (the `R.isUsable` branch). Maybe it is fine as it is... https://github.com/llvm/llvm-project/pull/84150 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits