| 1 |
/* PR c/39464 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-Wall" } */ |
| 4 |
|
| 5 |
typedef int T __attribute__((may_alias)); |
| 6 |
typedef unsigned int U __attribute__((may_alias)); |
| 7 |
|
| 8 |
void |
| 9 |
foo (void *p) |
| 10 |
{ |
| 11 |
T *a = (int *) p; /* { dg-bogus "initialization from incompatible pointer type" } */ |
| 12 |
int *b = (T *) p; /* { dg-bogus "initialization from incompatible pointer type" } */ |
| 13 |
U *c = (unsigned int *) p; /* { dg-bogus "initialization from incompatible pointer type" } */ |
| 14 |
unsigned int *d = (U *) p; /* { dg-bogus "initialization from incompatible pointer type" } */ |
| 15 |
(void) a; |
| 16 |
(void) b; |
| 17 |
(void) c; |
| 18 |
(void) d; |
| 19 |
} |