-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[clang] Segmentation fault with static_assert(__builtin_is_implicit_lifetime(int __attribute__((btf_type_tag("user"))) *))
#106864
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-frontend Author: Hristo Hristov (Zingam)
The following libc++ lit test causes a segmentation fault:
#include <cassert>
template <typename T>
constexpr void test1() {
assert(true);
static_assert(__builtin_is_implicit_lifetime(int __attribute__((btf_type_tag("user"))) *));
}
constexpr bool test() {
test1<int>();
return true;
}
int main(int, char**) {
test();
static_assert(test());
return 0;
}
|
There's an assertion failure with templates containing a template <typename T>
void test1() {
static_assert(!__is_void(int __attribute__((btf_type_tag("user"))) *));
}
void test() {
test1<int>();
}
llvm-project/clang/lib/Sema/TreeTransform.h Lines 7455 to 7460 in cd3667d
This crash also happens for Also a bit concerning that there's a |
I think the assertions don't make sense. afaict there is nothing that would prevent a c++ program to create those. |
Looks like a clang-15 regression: https://godbolt.org/z/9zM3668zW |
Well that's certainly a surprise!
So this should only be available in C, not C++. However, it seems that the code to actually prohibit this in C is not being called in |
This was always intended to be disallowed in C++ (see the definition in Attr.td), but failed to add the correct checking code in SemaType.cpp to ensure it was rejected. Fixes llvm#106864
The following libc++ lit test causes a segmentation fault:
The text was updated successfully, but these errors were encountered: