summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C
blob: c82fd56d9896bada3a37a4a89918e71e12438dc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// { dg-do run  }
// Error: intenral compiler error on 1998/05/28 snapshot.
#include <stdio.h>
#include <stdlib.h>

void evilRises (void **ptr)
{
    int *pi;

    pi = new int;

    *pi = 0;

    *ptr = (void *)pi;
}

int main (int argc, char *argv[])
{
#ifdef WORKAROUND
    union foo
#else
    union
#endif
    {
        int a;
        int b;
        int c;
    } *fred, barney;

    evilRises((void **)&fred);

    barney = *fred;

    return EXIT_SUCCESS;
}