1// PR c++/32384
2// { dg-do compile }
3
4struct A
5{
6  typedef int T;
7  T foo ();
8
9  A () { foo ().~T (); }
10};
11
12template<typename> struct B
13{
14  typedef int T;
15  T foo ();
16
17  B () { foo ().~T (); }
18};
19
20template<typename T> struct C
21{
22  T t;
23  C () { t.~T (); }
24};
25
26template<typename S> struct D
27{
28  typedef int T;
29  S foo ();
30
31  D () { foo ().~T(); }
32};
33
34struct Z
35{
36  Z () {}
37  ~Z () {}
38};
39
40A a;
41B<int> b;
42C<int> c1;
43C<Z> c2;
44D<int> d;
45