FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / nest20.C
blob297b08af825c1917f7b15d799ba7cbc6f2569b20
1 // Build don't link: 
2 // GROUPS passed nested-classes
3 // This is the first line of file ||t5.C||.
5 // This code initializing an unnamed union inside a class appears to
6 // be legal C++ input and compiles fine with AT&T cfront 3.0.1, but
7 // gcc 2.4.5 complains about multiple initializations of the same
8 // member.
10 class Expr {
11 public:
12     enum Type { undefined, slong, ulong, ldouble };
13     Expr();
14     Expr(Type type, const Expr* initializer);
15 private:
16     Type type_;
17     union {
18         long slong_;
19         unsigned long ulong_;
20         long double ldouble_;
21     };
24 // Construct an undefined expression.
26 Expr::Expr()
27     :
28     type_(undefined),
29     slong_(-1)