| 1 |
// PR c++/104944 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "-Wpedantic" } |
| 4 |
|
| 5 |
struct inc; |
| 6 |
|
| 7 |
struct alignas(inc) S1 { }; // { dg-error "invalid application" } |
| 8 |
struct alignas(void) S2 { }; // { dg-error "invalid application" } |
| 9 |
|
| 10 |
template <typename T> |
| 11 |
struct alignas(T) S4 {}; // { dg-error "invalid application" } |
| 12 |
|
| 13 |
template <typename T> |
| 14 |
struct alignas(T) S5 {}; // { dg-error "invalid application" } |
| 15 |
|
| 16 |
S4<void> s1; |
| 17 |
S5<inc> s2; |
| 18 |
|
| 19 |
void |
| 20 |
g () |
| 21 |
{ |
| 22 |
auto s1 = alignof(void); // { dg-error "invalid application" } |
| 23 |
auto s2 = alignof(const void); // { dg-error "invalid application" } |
| 24 |
auto s3 = __alignof(void); // { dg-warning "invalid application" } |
| 25 |
auto s4 = alignof(inc); // { dg-error "invalid application" } |
| 26 |
} |