[clang] [Clang][Parser] Reject unbalanced unknown attribute arguments (PR #220259)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 21 05:52:09 PDT 2026
nehaGautam07 wrote:
Thanks for the extra tests. I updated SkipUntil so StopAtUnbalanced counts nested (), [], and {} instead of only stopping on the first unmatched closer. The normal skip path is unchanged.
[[X1([)]], [[X1({)]], and [[X1(()]] now only get the pedantic warning. They no longer error with expected ']' — that was us consuming the attribute's ]] while trying to recover. [[X1([[[[[]]]])]] is diagnosed as well, since there are five '[' and four ']'. [[X1())]] still says expected ',', which matches what you said about () already closing the argument list.
The parser test passes. I can put this commit on the compile-time tracker if that would help.
https://github.com/llvm/llvm-project/pull/220259
More information about the cfe-commits
mailing list