| 1 |
// { dg-do assemble } |
| 2 |
void *vp; |
| 3 |
int (*ap)[]; |
| 4 |
struct S *sp; |
| 5 |
union U *up; |
| 6 |
int (*fp)(); |
| 7 |
|
| 8 |
void |
| 9 |
test () |
| 10 |
{ |
| 11 |
vp++; /* { dg-error "5:ISO C\\+\\+ forbids incrementing" } incrementing void * */ |
| 12 |
ap++; /* { dg-error "5:cannot increment" } incrementing ptr to incomplete type */ |
| 13 |
sp++; /* { dg-error "5:cannot increment" } incrementing ptr to incomplete type */ |
| 14 |
up++; /* { dg-error "5:cannot increment" } incrementing ptr to incomplete type */ |
| 15 |
fp++; /* { dg-error "5:ISO C\\+\\+ forbids incrementing" } incrementing ptr to function */ |
| 16 |
} |