gcc/testsuite/g++.dg/cpp1z/inline-var7.C
raw| 1 | // PR c++/87512 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | |
| 4 | template <int, typename T = int> using enable_if_t = int; |
| 5 | template<typename T> struct is_pointer { enum { value = 0 }; }; |
| 6 | |
| 7 | template <typename T> |
| 8 | inline constexpr auto IsPtr = is_pointer<T>::value; |
| 9 | |
| 10 | class Foo; |
| 11 | class Bar; |
| 12 | |
| 13 | template <typename T1, typename T2> |
| 14 | void foo(T1, T2); |
| 15 | |
| 16 | template <typename T> |
| 17 | enable_if_t<IsPtr<T>> foo(T, Foo); |
| 18 | |
| 19 | template <> |
| 20 | void foo<Bar>(Bar, Bar); |