Debian Codegraph @

gcc/testsuite/g++.dg/opt/pr82159-2.C

raw
1 // PR c++/82159
2 // { dg-do compile }
3 // { dg-options " -Wno-return-type" }
4
5 template <typename T> struct D { T e; };
6 struct F : D<int[0]> {
7 F(const F &);
8 };
9 struct G : F {
10 template <class T> G operator-(T);
11 };
12 template <class T> struct I {
13 typedef typename T::template J<I> ak;
14 };
15 template <class T> struct K { typename I<T>::ak an; };
16 struct H {
17 G l;
18 };
19 struct C {
20 ~C();
21 };
22 template <class T> struct M : T {
23 template <typename U, typename V> M(U, V);
24 H h;
25 virtual void foo() { T::bar(&h); }
26 };
27 template <int, typename> class A;
28 template <class> struct B {
29 typedef int BT;
30 struct BC {};
31 template <class T> struct BD {
32 G g;
33 BD(BT, T n) : g(n.l - 0) {}
34 };
35 B(BT, BC);
36 };
37 template <typename> struct O;
38 template <int T, typename U>
39 struct O<B<A<T, U> > > : public B<A<T, U> >::BC {};
40 struct L : B<A<2, double> > {
41 struct P : C {
42 void bar(H *x) {
43 BT a;
44 BD<H>(a, *x);
45 }
46 };
47 template <typename U, typename V> L(U x, V n) : B(x, n) {}
48 int ll;
49 virtual int baz() { M<P>(this, ll); }
50 };
51 template <typename> class Q {
52 O<B<A<2, double> > > q;
53 virtual L baz() { L(0, q); }
54 };
55 template <template <class> class T> struct R {
56 R() { T<int>(); }
57 };
58 struct S {
59 template <class> class J : R<Q> {};
60 };
61 void foo() { K<S> c; }
62
63 int main() {
64 return 0;
65 }