gcc/testsuite/g++.old-deja/g++.robertl/eb102.C
raw| 1 | // { dg-do run } |
| 2 | // Error: intenral compiler error on 1998/05/28 snapshot. |
| 3 | #include <stdio.h> |
| 4 | #include <stdlib.h> |
| 5 | |
| 6 | void evilRises (void **ptr) |
| 7 | { |
| 8 | int *pi; |
| 9 | |
| 10 | pi = new int; |
| 11 | |
| 12 | *pi = 0; |
| 13 | |
| 14 | *ptr = (void *)pi; |
| 15 | } |
| 16 | |
| 17 | int main (int argc, char *argv[]) |
| 18 | { |
| 19 | #ifdef WORKAROUND |
| 20 | union foo |
| 21 | #else |
| 22 | union |
| 23 | #endif |
| 24 | { |
| 25 | int a; |
| 26 | int b; |
| 27 | int c; |
| 28 | } *fred, barney; |
| 29 | |
| 30 | evilRises((void **)&fred); |
| 31 | |
| 32 | barney = *fred; |
| 33 | |
| 34 | return EXIT_SUCCESS; |
| 35 | } |