-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Crash in Clang 17 front-end for code that previously worked #67317
Comments
Assertion is:
|
@llvm/issue-subscribers-clang-frontend
Hello,
the following code which is a reduced test case from C++ Insights (https://github.com/andreasfertig/cppinsights/blob/9147b894b814a3d7dcf82ac9b16965680baffeb1/tests/FieldDeclArrayRef2Test.cpp) leads to a crash in the front-end with Clang 17 while it worked with the previous versions (https://compiler-explorer.com/z/c51Gxj7b5): struct array
{
int (&data)[2];
array() : data(*new int[1][2]) { }
};
int main()
{
array a;
}
Andreas |
Relevant patch: https://reviews.llvm.org/D146358 The crash is happening in UB-checking use of constexpr evaluator, where it evaluates the expression One weird thing is that I cannot get the old diagnostics for this crashing case printed. I cannot reproduce the crash from non-UB-checking use of constexpr evaluator. Falling back to the old diagnostics would be generally good, but I'm a little concerned that it may end up generating diagnostics that no one is going to see. About the UB-checking usage, llvm-project/clang/lib/Sema/SemaChecking.cpp Lines 15849 to 15852 in 7e8a0e4
a + b or ++a . I tinkered this part a little bit yesterday and reported 4 crashses, all of which seemed to be caused by other unhealthy codes, so this piece of code would probably be OK.
|
https://reviews.llvm.org/D146358 was assuming that all subobjects have their own name (`SubobjectDecl`), but it was not true for array elements. Fixes llvm#67317
/branch hazohelet/llvm-project/release/17.x |
/pull-request llvm/llvm-project-release-prs#751 |
I'm sorry, the error was caused by my mistake. |
…7817) https://reviews.llvm.org/D146358 was assuming that all subobjects have their own name (`SubobjectDecl`), but it was not true for array elements. Fixes llvm#67317
Hello,
the following code which is a reduced test case from C++ Insights (https://github.com/andreasfertig/cppinsights/blob/9147b894b814a3d7dcf82ac9b16965680baffeb1/tests/FieldDeclArrayRef2Test.cpp) leads to a crash in the front-end with Clang 17 while it worked with the previous versions (https://compiler-explorer.com/z/c51Gxj7b5):
Andreas
The text was updated successfully, but these errors were encountered: