OSDN Git Service

/cp
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / pseudodtor3.C
1 // PR c++/32241
2 // { dg-do compile }
3
4 struct A
5 {
6   typedef int T;
7   T &foo ();
8   A () { foo.~T (); }   // { dg-error "does not have class type|expected" }
9 };
10
11 template <typename T> struct B
12 {
13   T &foo ();
14   B () { foo.~T (); }   // { dg-error "invalid use of member" }
15 };
16
17 B<int> b;
18
19 template <typename T, typename S> struct C
20 {
21   T t;
22   C () { t.~S (); }     // { dg-error "is not of type" }
23 };
24
25 C<int, long int> c;
26
27 template <typename T> struct D
28 {
29   T t;
30   typedef long int U;
31   D () { t.~U (); }     // { dg-error "is not of type" }
32 };
33
34 D<int> d;
35
36 template <typename T> struct E
37 {
38   T &foo ();
39   typedef long int U;
40   E () { foo.~U (); }   // { dg-error "is not of type" }
41 };
42
43 E<int> e;