]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/ipa/devirt-52.C
Merge dg-options and dg-additional-options if len <= 120 chars.
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / ipa / devirt-52.C
CommitLineData
458a1cd0
JJ
1// PR middle-end/77259
2// { dg-do compile { target c++11 } }
d2148424 3// { dg-options "-O2 -Wno-return-type" }
458a1cd0
JJ
4
5template <typename, typename = int> class A;
6template <typename, typename> struct A
7{
8 A (A &&);
9};
10template <typename S, typename T, typename U>
11A<S> operator+(S *, const A<T, U> &);
12template <typename S, typename T, typename U>
13void operator+(const A<T, U> &, S *);
14struct B
15{
16 template <typename V> B (V);
17};
18template <typename V> V foo (B) {}
19class C;
20template <typename> struct D
21{
22 C *operator->() { return d; }
23 C *d;
24};
25struct C
26{
27 virtual A<int> bar ();
28};
29struct E
30{
31 ~E ();
32 virtual A<char> bar (const B &) const;
33};
34template <typename> struct F : E
35{
36};
37template <typename W> struct F<D<W>> : E
38{
39 A<char> bar (const B &) const try
40 {
41 D<W> a = baz ();
42 }
43 catch (int)
44 {
45 }
46 D<W> baz () const
47 {
48 D<C> b = foo<D<C>>(0);
49 "" + b->bar () + "";
50 }
51};
52struct G : F<D<int>>
53{
54 G (int);
55};
56void test () { G (0); }