Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/g++.dg/ipa/devirt-52.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/g++.dg/ipa/devirt-52.C Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,56 @@ +// PR middle-end/77259 +// { dg-do compile { target c++11 } } +// { dg-options "-O2" } + +template <typename, typename = int> class A; +template <typename, typename> struct A +{ + A (A &&); +}; +template <typename S, typename T, typename U> +A<S> operator+(S *, const A<T, U> &); +template <typename S, typename T, typename U> +void operator+(const A<T, U> &, S *); +struct B +{ + template <typename V> B (V); +}; +template <typename V> V foo (B) {} +class C; +template <typename> struct D +{ + C *operator->() { return d; } + C *d; +}; +struct C +{ + virtual A<int> bar (); +}; +struct E +{ + ~E (); + virtual A<char> bar (const B &) const; +}; +template <typename> struct F : E +{ +}; +template <typename W> struct F<D<W>> : E +{ + A<char> bar (const B &) const try + { + D<W> a = baz (); + } + catch (int) + { + } + D<W> baz () const + { + D<C> b = foo<D<C>>(0); + "" + b->bar () + ""; + } +}; +struct G : F<D<int>> +{ + G (int); +}; +void test () { G (0); }