blob: f05b1943a9c8e8ed17de138289465e413bfcf151 (
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
36
37
38
39
40
41
42
43
44
45
46
|
// { dg-do run }
// GROUPS passed copy-ctors
#include <iostream>
// token types: from state parser
const int T_EOF = 257;
const int T_ERROR = 258;
const int T_Float = 259;
const int T_Int = 260;
const int T_ID = 261;
const int T_STRING = 262;
class Complex;
class State;
// token, from state parser.
class ParseToken {
public:
int tok;
union {
char cval;
const char *sval;
int intval;
double doubleval;
Complex* Complexval;
const State* s;
};
ParseToken () { tok = 0; intval = 0;}
};
int
main () {
ParseToken a;
a.tok = T_Float;
a.doubleval = 23.2;
ParseToken b(a);
if (b.doubleval == 23.2)
std::cout << "PASS\n";
else
{
std::cout << "FAIL\n";
return 1;
}
}
|