1 // PR c++/69022 - attribute vector_size ignored with dependent bytes
5 struct A { static const int X = N; };
7 #if __cplusplus >= 201202L
8 # define ASSERT(e) static_assert (e, #e)
11 do { struct S { bool: !!(e); } asrt; (void)&asrt; } while (0)
14 template <class T, int N>
17 #if __cplusplus >= 201202L
21 # define VecSize A<N>::X
26 char a __attribute__ ((vector_size (N)));
27 ASSERT (sizeof a == N);
29 T b __attribute__ ((vector_size (N)));
30 ASSERT (sizeof b == N);
35 char c1 __attribute__ ((vector_size (VecSize)));
36 ASSERT (sizeof c1 == VecSize);
38 char c2 __attribute__ ((vector_size (A<N>::X)));
39 ASSERT (sizeof c2 == A<N>::X);
41 T d1 __attribute__ ((vector_size (VecSize)));
42 ASSERT (sizeof d1 == VecSize);
44 T d2 __attribute__ ((vector_size (A<N>::X)));
45 ASSERT (sizeof d2 == A<N>::X);