-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[clang] Assertion `!isTokenSpecial() && "Should consume special tokens with Consume*Token"' failed. #113722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
crash-on-invalid
generated by fuzzer
Comments
@llvm/issue-subscribers-clang-frontend Author: Yihan Yang (yijan4845)
**This testcase is generated by a fuzzer.**
Compiler Explorer: https://godbolt.org/z/9EEEefGbT This invalid code will crash on Clang Assertion Trunk: struct S {
void m(int x = 0,
#pragma message "Any message") {
int z = 0;
#pragma unused(x)
}
}; It seems that this goes back to clang-5. Stack dump:
|
A simpler reproducer is:
The issue is that the pragma is appearing within a malformed parameter list for a member function. |
AaronBallman
added a commit
to AaronBallman/llvm-project
that referenced
this issue
May 12, 2025
We cannot consume annotation tokens with ConsumeToken(), so any pragmas present in an invalid initializer would previously crash. Now we handle annotation tokens more generally and avoid the crash. Fixes llvm#113722
AaronBallman
added a commit
that referenced
this issue
May 13, 2025
We cannot consume annotation tokens with ConsumeToken(), so any pragmas present in an invalid initializer would previously crash. Now we handle annotation tokens more generally and avoid the crash. Fixes #113722
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
crash-on-invalid
generated by fuzzer
This testcase is generated by a fuzzer.
Compiler Explorer: https://godbolt.org/z/9EEEefGbT
This invalid code will crash on Clang Assertion Trunk:
It seems that this goes back to clang-5.
Stack dump:
The text was updated successfully, but these errors were encountered: