Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.brendan/copy9.C

raw
1 // { dg-do run }
2 // { dg-additional-options "-fexcess-precision=fast" }
3 // { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } }
4 // GROUPS passed copy-ctors
5 #include <iostream>
6
7 // token types: from state parser
8 const int T_EOF = 257;
9 const int T_ERROR = 258;
10 const int T_Float = 259;
11 const int T_Int = 260;
12 const int T_ID = 261;
13 const int T_STRING = 262;
14
15 class Complex;
16 class State;
17
18 // token, from state parser.
19 class ParseToken {
20 public:
21 int tok;
22 union {
23 char cval;
24 const char *sval;
25 int intval;
26 double doubleval;
27 Complex* Complexval;
28 const State* s;
29 };
30 ParseToken () { tok = 0; intval = 0;}
31 };
32
33 int
34 main () {
35 ParseToken a;
36 a.tok = T_Float;
37 a.doubleval = 23.2;
38 ParseToken b(a);
39
40 if (b.doubleval == 23.2)
41 std::cout << "PASS\n";
42 else
43 {
44 std::cout << "FAIL\n";
45 return 1;
46 }
47 }
48