-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[Clang] crashes with _Atomic _Complex int #114885
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
Comments
@llvm/issue-subscribers-clang-codegen Author: Zitong Zhou Eric (ZitongZhouEric)
To reproduce: https://godbolt.org/z/vvzPhaoTW
Clang trunk crashes on the following snippet
```c
int foo() {
_Atomic int ok = (_Atomic int)2;
_Atomic _Complex int buggy = (_Atomic _Complex int)2;
return 0;
}
int main() {
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
clang: /root/llvm-project/clang/include/clang/AST/Type.h:8792: const T* clang::Type::castAs() const [with T = clang::ComplexType]: Assertion `isa<T>(CanonicalType)' failed.
|
@llvm/issue-subscribers-c11 Author: Zitong Zhou Eric (ZitongZhouEric)
To reproduce: https://godbolt.org/z/vvzPhaoTW
Clang trunk crashes on the following snippet
```c
int foo() {
_Atomic int ok = (_Atomic int)2;
_Atomic _Complex int buggy = (_Atomic _Complex int)2;
return 0;
}
int main() {
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
clang: /root/llvm-project/clang/include/clang/AST/Type.h:8792: const T* clang::Type::castAs() const [with T = clang::ComplexType]: Assertion `isa<T>(CanonicalType)' failed.
|
A more simple test case:
Removing the cast in the initialization causes the issue to go away. |
To reproduce: https://godbolt.org/z/vvzPhaoTW
Clang trunk crashes on the following snippet
Not sure if this is related to #111293, which reports the same assertion failure but doesn't crash clang without assertions
On clang trunk with assertions:
The text was updated successfully, but these errors were encountered: