| 1 |
// PR c++/46890 |
| 2 |
// { dg-do compile } |
| 3 |
|
| 4 |
struct OK1 |
| 5 |
{ |
| 6 |
int i; |
| 7 |
} const *ok1_var; // No complains |
| 8 |
|
| 9 |
struct OK2; |
| 10 |
extern OK2 ok2a_var; |
| 11 |
|
| 12 |
struct OK2 |
| 13 |
{ |
| 14 |
int i; |
| 15 |
} const &ok2_var = ok2a_var; // No complains |
| 16 |
|
| 17 |
struct OK3 |
| 18 |
{ |
| 19 |
int i; |
| 20 |
} volatile (ok3_var); // No complains |
| 21 |
|
| 22 |
struct E1 |
| 23 |
{ |
| 24 |
int i; |
| 25 |
} const; // { dg-error "'const' can only be specified for objects and functions" } |
| 26 |
|
| 27 |
void foo ( |
| 28 |
struct E2 // { dg-warning "deprecated" "" { target c++2a } } |
| 29 |
{ // { dg-error "types may not be defined in parameter types" } |
| 30 |
int i; |
| 31 |
} volatile); |
| 32 |
|
| 33 |
void bar ( |
| 34 |
struct E3 |
| 35 |
{ // { dg-error "types may not be defined in parameter types" } |
| 36 |
int i; |
| 37 |
} const, int); |