diff options
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/auto-fn27.C | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn27.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn27.C new file mode 100644 index 0000000..c9291c2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn27.C @@ -0,0 +1,42 @@ +// PR c++/66919 +// { dg-do compile { target c++14 } } + +template <int> +struct A { + template <typename F, typename R, typename T> + static auto run (F fn, R, T) { auto r = fn (); } // { dg-error "" } +}; +template <typename F, typename T> +auto foo (F fn, T) +{ + A <0>::run (fn, 0, 0); +} +struct B; +struct C { + typedef B D; +}; +struct E { + virtual void bar (const int &); +}; +template <typename C> +struct F : E { + typedef typename C::D::G G; + void bar (const G &); + typename C::D::H I; +}; +struct J { struct K {}; }; +template <typename T> +void +F<T>::bar (const G &) +{ + auto s = I; + typedef decltype (s) L; + auto u =[&](L) { auto t = foo (J::K (), 0); }; // { dg-error "" } +} +struct B { + typedef int G; + typedef int H; +}; +struct M : F <C> { + M () {} +}; |