PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / overload / template6.C
blobf2650aacba90a069bf4da2217322cad7cf3e52db
1 // { dg-do compile { target c++11 } }
3 template <typename>
4 struct is_function {
5   static constexpr bool value = false;
6 };
8 template <typename R, typename ...Args>
9 struct is_function<R(Args...)>
11   static constexpr bool value = true;
14 template<bool, typename> struct enable_if {};
16 template<typename T> struct enable_if<true, T> 
18   typedef T type;
21 template <class T>
22 struct remove_pointer
24   typedef T type;
27 template <class T>
28 struct remove_pointer<T*>
30   typedef T type;
33 void f(int) {}
34 void f(double) {}
36 template <class T>
37 struct X
39   template <class U=T,
40             typename enable_if<is_function<
41                                  typename remove_pointer<U>::type>::value,
42                                bool>::type = false> X(U&&) {}
45 int main() {
46   X<void(*)(int)> x0(f);