2 // { dg-do compile { target c++11 } }
3 // { dg-options "-O2" }
4 // { dg-additional-options "-Wno-return-type" }
6 template <typename, typename = int> class A;
7 template <typename, typename> struct A
11 template <typename S, typename T, typename U>
12 A<S> operator+(S *, const A<T, U> &);
13 template <typename S, typename T, typename U>
14 void operator+(const A<T, U> &, S *);
17 template <typename V> B (V);
19 template <typename V> V foo (B) {}
21 template <typename> struct D
23 C *operator->() { return d; }
28 virtual A<int> bar ();
33 virtual A<char> bar (const B &) const;
35 template <typename> struct F : E
38 template <typename W> struct F<D<W>> : E
40 A<char> bar (const B &) const try
49 D<C> b = foo<D<C>>(0);
57 void test () { G (0); }