comparison gcc/testsuite/g++.dg/lto/pr69589_1.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 struct A;
2 template <class T>
3 struct Q { Q (T); };
4 template<typename T, class D>
5 struct U {
6 ~U () { m1 (nullptr); }
7 D m2 ();
8 T *u;
9 void m1 (T *) { m2 () (u); }
10 };
11 struct F { F (int *); };
12 template <class, class T = F>
13 using W = Q<T>;
14 int a, b;
15 void fn1 (void *);
16 template <class T>
17 void
18 fn2 (T *x)
19 {
20 if (x)
21 x->~T();
22 fn1 (x);
23 }
24 template <typename T>
25 struct C {
26 void operator() (T *x) { fn2 (x); }
27 };
28 struct D;
29 template <typename T, typename D = C<T> >
30 using V = U<T, D>;
31 struct A {
32 A (int *);
33 };
34 struct S;
35 struct G {
36 V<S> m3 ();
37 };
38 struct S {
39 int e;
40 virtual ~S () {}
41 };
42 template<typename T>
43 struct H {
44 H (int, T x, int) : h(x) {}
45 G g;
46 void m4 () { g.m3 (); }
47 T h;
48 };
49 struct I {
50 I(A, W<D>);
51 };
52 void
53 test ()
54 {
55 A c (&b);
56 W<D> d (&b);
57 I e (c, d);
58 H<I> f (0, e, a);
59 f.m4 ();
60 }
61