| 1 |
// PR c++/65498 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
template <typename, typename> |
| 5 |
struct is_same |
| 6 |
{ |
| 7 |
enum { value = false }; |
| 8 |
constexpr bool operator()() const noexcept { return value; } |
| 9 |
}; |
| 10 |
|
| 11 |
template <typename T> |
| 12 |
struct is_same<T, T> |
| 13 |
{ |
| 14 |
enum { value = true }; |
| 15 |
constexpr bool operator()() const noexcept { return value; } |
| 16 |
}; |
| 17 |
|
| 18 |
template <bool, typename = void> |
| 19 |
struct enable_if { }; |
| 20 |
|
| 21 |
template <typename T> |
| 22 |
struct enable_if<true, T> { typedef T type; }; |
| 23 |
|
| 24 |
struct A; |
| 25 |
|
| 26 |
template <typename, typename = void> |
| 27 |
struct F { }; |
| 28 |
|
| 29 |
template <typename X> |
| 30 |
struct F<X, typename enable_if<is_same<X, A>{}()>::type> { |
| 31 |
template <typename MakeDependent> |
| 32 |
F(MakeDependent) { |
| 33 |
auto ICE_HERE = __func__; |
| 34 |
(void)ICE_HERE; // avoid -Wunused-variable |
| 35 |
} |
| 36 |
}; |
| 37 |
|
| 38 |
int main() { |
| 39 |
F<A>{1}; |
| 40 |
} |