Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / g++.dg / template / pseudodtor3.C
blob5f392f4e492e26907b3d9b04c9f487886ce1d33f
1 // PR c++/32241
2 // { dg-do compile }
4 struct A
6   typedef int T;
7   T &foo ();
8   A () { foo.~T (); }   // { dg-error "does not have class type|expected" }
9 };
11 template <typename T> struct B
13   T &foo ();
14   B () { foo.~T (); }   // { dg-error "invalid use of member" }
17 B<int> b;
19 template <typename T, typename S> struct C
21   T t;
22   C () { t.~S (); }     // { dg-error "is not of type" }
25 C<int, long int> c;
27 template <typename T> struct D
29   T t;
30   typedef long int U;
31   D () { t.~U (); }     // { dg-error "is not of type" }
34 D<int> d;
36 template <typename T> struct E
38   T &foo ();
39   typedef long int U;
40   E () { foo.~U (); }   // { dg-error "is not of type" }
43 E<int> e;