2 // { dg-do compile { target c++14 } }
4 template <typename T, T n> struct C { static constexpr T D = n; };
5 struct E : C<bool, false> {};
6 template <typename> struct F : C<bool, false> {};
7 template <typename T> T foo ();
8 template <typename> struct H { typedef int G; };
9 template <typename> class I;
11 template <typename, typename> struct J;
12 template <bool, bool, typename...> struct K;
14 template <typename M, typename... N>
15 static J<decltype (foo<M> () (foo<N>...)), L> o;
17 template <typename P, typename... Q> struct K<false, false, P, Q...> : R {
18 typedef decltype (o<P, Q...>) G;
20 template <typename P, typename... Q>
21 struct D : K<E::D, F<typename H<P>::G>::D, P, Q...> {};
22 template <typename P, typename... Q> struct I<P (Q...)> : D<P, Q...> {};
23 template <typename> class function;
24 template <typename S, typename... Q> struct function<S (Q...)> {
25 template <typename T, typename = typename I<T (Q...)>::G> struct C;
26 template <typename, typename> using U = int;
27 template <typename P, typename = U<int, void>, typename = U<C<P>, void>>
30 template <typename S, typename... Q>
31 template <typename P, typename, typename>
32 function<S (Q...)>::function (P)
35 void bar (function<void (int)>);
42 bar ([] (auto) { counter++; });