OSDN Git Service

fix implicit int
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.brendan / copy9.C
1 // GROUPS passed copy-ctors
2 #include <iostream.h>
3
4 // token types: from state parser
5 const int T_EOF = 257;
6 const int T_ERROR = 258;
7 const int T_Float = 259;
8 const int T_Int = 260;
9 const int T_ID = 261;
10 const int T_STRING = 262;
11
12 class Complex;
13 class State;
14
15 // token, from state parser.
16 class ParseToken {
17 public:
18         int tok;
19         union {
20                 char cval;
21                 const char *sval;
22                 int intval;
23                 double  doubleval;
24                 Complex* Complexval;
25                 const State*  s;
26         }; 
27         ParseToken () { tok = 0; intval = 0;}
28 };
29
30 int
31 main () {
32         ParseToken a;
33         a.tok = T_Float;
34         a.doubleval = 23.2;
35         ParseToken b(a);
36
37         if (b.doubleval == 23.2)
38           cout << "PASS\n";
39         else
40           cout << "FAIL\n";
41 }