[clang] [clang-repl] Fix Lexical DeclContext Mismatch Inside Namespaces (PR #206807)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 1 00:38:25 PDT 2026


yashg16422-design wrote:

Hey @vgvassilev I understand this PR might feel incomplete but this error , though produces the required behaiviour eliminating the SIGABRT error, any test like
` namespace v1 { int x = }` 
or
>  any declaration between { }
will always trigger the **[-ferror-limit=]** due to the underlying **ParseTopLevelStmtDecl()** bug similarly discussed in #127569 .
Because this secondary bug causes `clang-repl` to hang indefinitely on invalid input, an automated regression test cannot be checked in with this PR as it would stall the test runner. I have filed this infinite loop behavior as a separate issue tracking the core parser recovery infrastructure.
I tried adding the test thinking its in non interactive mode but still with the tests same error occured 

> Because it still processes them through IncrementalParser::Parse, it encounters the same pre-existing error-recovery loop you discovered earlier( likely reason )

Untill that issue is resolved you can stall this PR, it sgould have been opened as an issue I guess ,Im sorry for not following the guidelines but this PR clearly tackles issue #206670 thats why I think it could be merged after clearing it ofc with the proper test alterations provided.

https://github.com/llvm/llvm-project/pull/206807


More information about the cfe-commits mailing list