Open llvmbot opened 10 years ago
We still issue a bogus error for the second example.
closing per comment 1.
Crash fixed in r193295.
Error is still issued as of post-17 trunk: https://godbolt.org/z/ocf5cMKGe
<source>:8:17: error: static assertion failed due to requirement 'alignof(int) == 1': wrong alignment
8 | static_assert(alignof(T2) == 1, "wrong alignment"); // error
| ^~~~~~~~~~~~~~~~
<source>:8:29: note: expression evaluates to '4 == 1'
8 | static_assert(alignof(T2) == 1, "wrong alignment"); // error
| ~~~~~~~~~~~~^~~~
1 error generated.
Extended Description
The current trunk version of clang in C++11 mode reports an error for the second static assert in the following sample (but not for the equivalent first one) and crashes for the T3 typedef.
int main() { typedef int attribute((aligned(1))) T1; // no error static_assert(alignof(T1) == 1, "wrong alignment");
constexpr int A = 1;
using T2 = int attribute((aligned(A))); static_assert(alignof(T2) == 1, "wrong alignment"); // error
typedef int attribute((aligned(A))) T3; // crash static_assert(alignof(T3) == 1, "wrong alignment"); }