PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / template / pr68948.C
blob3cb684417afaad36f78ab0c6b1f5825fc636e8ad
1 // PR c++/68948
3 struct B { B (); B (int); };
5 struct Time : B { };
7 /* Here, A and B are unrelated types.  */
9 template <typename>
10 struct A
12   void TestBody ()
13   {
14     B::B (); // { dg-error "cannot call constructor .B::B." }
15     B::B::B (); // { dg-error "cannot call constructor .B::B." }
16     B::B (0); // { dg-error "cannot call constructor .B::B." }
17   }
20 /* Here, C is (indirectly) derived from B.  */
22 template <typename g>
23 struct C : Time
25   void TestBody ()
26   {
27     B::B (); // { dg-error "cannot call constructor .B::B." }
28     B::B::B (); // { dg-error "cannot call constructor .B::B." }
29     B::B (0); // { dg-error "cannot call constructor .B::B." }
30     Time::B (0);
31   }
34 int
35 main (void)
37   A<int> a;
38   C<int> c;
39   a.TestBody ();
40   c.TestBody ();