1 // test of rtti of non-class types
2 // Special g++ Options: -frtti
7 int printf(const char *, ...);
25 const volatile int cvi = 10;
26 volatile const int vci = 20;
32 enum color { red, blue, green, yellow};
50 int yyf1 (float f) {};
51 double yyf2 () {return yyd;};
61 int (XX::*ptmf3) (int);
83 if (typeid(i) != typeid(int)) error(1);
84 if (typeid(s) != typeid(short)) error(2);
85 if (typeid(c) != typeid(char)) error(3);
86 if (typeid(l) != typeid(long)) error(4);
87 if (typeid(ui) != typeid(unsigned int)) error(5);
88 if (typeid(us) != typeid(unsigned short)) error(6);
89 if (typeid(uc) != typeid(unsigned char)) error(7);
90 if (typeid(ul) != typeid(unsigned long)) error(8);
91 if (typeid(f) != typeid(float)) error(9);
92 if (typeid(d) != typeid(double)) error(10);
94 if (typeid(*pi) != typeid(int)) error(51);
95 if (typeid(pi) == typeid(ai)) error(52);
96 if (typeid(ri) != typeid(i)) error(53);
97 if (typeid(cvi) != typeid(vci)) error (54);
98 if (typeid(vci) != typeid(i)) error(55);
99 if (typeid(ci) != typeid(cvi)) error (56);
100 if (typeid(ci) != typeid(const int)) error(57);
102 if (typeid(func1) != typeid(func2)) error (81);
103 if (typeid(func2) == typeid(func3)) error (82);
104 if (typeid(func1) == typeid(func4)) error (83);
105 if (typeid(func3) == typeid(func4)) error (84);
107 if (typeid(red) != typeid(color)) error (101);
108 if (typeid(green) != typeid(blue)) error (102);
110 if (typeid(fp) != typeid(gp)) error (103);
111 if (typeid(gp) == typeid(hp)) error (104);
113 if (typeid(ptmd1) != typeid(ptmd2)) error (105);
114 if (typeid(ptmd1) == typeid(ptmd3)) error (106);
115 if (typeid(ptmd2) == typeid(ptmd4)) error (107);
117 if (typeid(ptmf1) != typeid(ptmf2)) error (108);
118 if (typeid(ptmf2) == typeid(ptmf3)) error (109);
119 if (typeid(ptmf1) == typeid(ptmf4)) error (110);