1 /* Test for non-lvalue arrays: test that qualifiers on non-lvalues
2 containing arrays do not remain when those arrays decay to
4 /* { dg-do compile } */
5 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
15 int *p1 = s.a; /* { dg-error "qualifiers" } */
16 int *p2 = (a ? s : s).a;
17 /* In this case, the qualifier is properly on the array element type
18 not on the rvalue structure and so is not discarded. */
22 int *p3 = t.a; /* { dg-error "qualifiers" } */
23 int *p4 = (a ? t : t).a; /* { dg-error "qualifiers" } */
24 /* The issue could also lead to code being wrongly accepted. */
28 const int (*p5)[1] = u.a;
29 const int (*p6)[1] = (a ? u : u).a; /* { dg-error "pointer" } */