2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr37561.c
blob3ad826329f9aa64dfee4bcbb2f0668c88641d973
1 /* PR c++/37561 */
2 /* { dg-do compile } */
4 __extension__ __INTPTR_TYPE__ p;
5 char q;
7 void
8 foo ()
10 ((char *) p)++; /* { dg-error "lvalue" } */
11 ((char *) q)++; /* { dg-error "lvalue" } */
12 ((char *) p)--; /* { dg-error "lvalue" } */
13 ((char *) q)--; /* { dg-error "lvalue" } */
14 ++(char *) p; /* { dg-error "lvalue" } */
15 ++(char *) q; /* { dg-error "lvalue" } */
16 --(char *) p; /* { dg-error "lvalue" } */
17 --(char *) q; /* { dg-error "lvalue" } */
20 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 11 } */
21 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 13 } */
22 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 15 } */
23 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 17 } */