Merge from mainline
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / union1.C
blob9d700499daeffa42fdee9e87d3875bdb31a99970
1 // { dg-do assemble  }
2 // GROUPS passed unions
3 // anon-union file
4 // From: "Terry R. Coley" <terry@wag.caltech.edu>
5 // Date:     Tue, 25 Aug 1992 17:33:29 -0700
6 // Subject:  possible bug in gcc/g++
7 // Message-ID: <199208260033.AA19417@brahms.wag.caltech.edu>
9 typedef enum { BADBINOP = 0, PLUS, MINUS, MULT, DIV, POWR } binoptype;
10 typedef enum { BADUNOP = 0, NEG = POWR+1, SIN, COS, TAN } unoptype;
12 typedef struct {
13   const char *s;
14   union {
15     binoptype bop;
16     unoptype uop;
17   };
19 op_to_charp;
21 op_to_charp BINOPS[] = { {"+", PLUS},
22                          {"-", MINUS},
23                          {"*", MULT},
24                          {"/", DIV},
25                          {"^", POWR} };
27 int main() {
28   int dummy;