-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Clang crash for C++ in clang::Parser::isCXXDeclarationSpecifier #63052
Comments
@llvm/issue-subscribers-c-1 |
@llvm/issue-subscribers-clang-frontend |
The assertion message is:
Backtrace:
The original preprocessed file doesn't show any errors, so it could be valid code. Reduced version asserts the same way. But valid or not, clang shouldn't crash. |
Duplicate of: #57495 |
@Fznamznon I have an attempted fix here: https://reviews.llvm.org/D134334 I have been sitting on it b/c @erichkeane asked some good questions and I never got around to figuring them out. |
As I mentioned in my initial message, it does.
clang compiled in Debug mode, with extensive checks enabled. |
I can confirm this fix fixes the crash. |
I updated the PR based on feedback it should still fix this issue as well. |
…otate template name When attempting to decide if in C++17 a type template for class template argument deduction and the code is ill-formed the condition to break is checking the current token is an identifier when it should be checking if the next token is not ::. This fixes: #57495 #63052 Differential Revision: https://reviews.llvm.org/D134334
I found a compiler crash when compiling a C++ file. I was using Clang 15 but have reproduced a similar but not exactly the same failure in Clang 17, built from main.
The test_parse.cpp.ii.gz is the compressed preprocessed file. I have reduced it using clang-15 and clang-17 and both end up with:
This segfaults in clang-15 and aborts in clang-17 with:
File: test_parse.cpp.ii.gz
The text was updated successfully, but these errors were encountered: