1 /* PR c++/37561 */
2 /* { dg-do compile } */
3
4 __extension__ __INTPTR_TYPE__ p;
5 char q;
6
7 void
foo()8 foo ()
9 {
10 ((char *) p)++; /* { dg-error "lvalue" } */
11
12 ((char *) q)++; /* { dg-error "lvalue" } */
13 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
14
15 ((char *) p)--; /* { dg-error "lvalue" } */
16
17 ((char *) q)--; /* { dg-error "lvalue" } */
18 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
19
20 ++(char *) p; /* { dg-error "lvalue" } */
21
22 ++(char *) q; /* { dg-error "lvalue" } */
23 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
24
25 --(char *) p; /* { dg-error "lvalue" } */
26
27 --(char *) q; /* { dg-error "lvalue" } */
28 /* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } .-1 } */
29 }
30
31