Debian Codegraph @

gcc/testsuite/g++.dg/rtti/typeid7.C

raw
1 // PR c++/32260
2 // { dg-do compile }
3 // { dg-options "-O2 -W -Wall" }
4
5 #include <typeinfo>
6
7 const std::type_info &
8 f1 (int i)
9 {
10 return typeid (i + 1);
11 }
12
13 const std::type_info &
14 f2 ()
15 {
16 return typeid (int);
17 }
18
19 struct A
20 {
21 A ();
22 virtual ~A ();
23 void foo ();
24 };
25
26 const std::type_info &
27 f3 ()
28 {
29 return typeid (A);
30 }
31
32 const std::type_info &
33 f4 (A *p)
34 {
35 return typeid (*p);
36 }
37
38 const std::type_info &
39 f5 ()
40 {
41 return typeid (int *);
42 }
43
44 const std::type_info &
45 f6 ()
46 {
47 return typeid (int [26][12]);
48 }
49
50 const std::type_info &
51 f7 ()
52 {
53 return typeid (int [26][12]);
54 }
55
56 void (A::*pmr) ();
57 const std::type_info &
58 f8 ()
59 {
60 return typeid (pmr);
61 }