blob: ec712a7841d9189b0a2404bf27ff5cc2ca01eb01 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/* PR c++/37561 */
/* { dg-do compile } */
__extension__ __PTRDIFF_TYPE__ p;
char q;
void
foo ()
{
((char *) p)++; /* { dg-error "lvalue" } */
((char *) q)++; /* { dg-error "lvalue" } */
((char *) p)--; /* { dg-error "lvalue" } */
((char *) q)--; /* { dg-error "lvalue" } */
++(char *) p; /* { dg-error "lvalue" } */
++(char *) q; /* { dg-error "lvalue" } */
--(char *) p; /* { dg-error "lvalue" } */
--(char *) q; /* { dg-error "lvalue" } */
}
/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 11 } */
/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 13 } */
/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 15 } */
/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 17 } */
|