PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / rtti / typeid8.C
blob2b13be5ef5266b05a899b8bc8adaeeca4262c33e
1 // PR c++/36405
2 // { dg-do compile }
4 #include <typeinfo>
6 struct A
8   void foo ()
9   {
10     typeid (foo).name ();       // { dg-error "invalid use of member" }
11     typeid (A::foo).name ();    // { dg-error "invalid use of member" }
12   }
13   void bar ()
14   {
15     typeid (foo).name ();       // { dg-error "invalid use of member" }
16     typeid (A::foo).name ();    // { dg-error "invalid use of member" }
17   }
18   static void baz ()
19   {
20     typeid (baz).name ();
21     typeid (A::baz).name ();
22   }
25 const char *p1 = typeid (A::foo).name ();       // { dg-error "invalid use of non-static member" }
26 const char *p2 = typeid (A::baz).name ();