| 1 |
// PR c++/59759 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
namespace std { |
| 5 |
template <typename _Tp> |
| 6 |
struct B { |
| 7 |
static constexpr _Tp value = 0; |
| 8 |
}; |
| 9 |
typedef B<int> false_type; |
| 10 |
struct C : false_type {}; |
| 11 |
template <typename> |
| 12 |
struct is_integral : C {}; |
| 13 |
template <int, typename _Tp> |
| 14 |
struct enable_if { |
| 15 |
typedef _Tp type; |
| 16 |
}; |
| 17 |
} |
| 18 |
enum class enabled; |
| 19 |
constexpr enabled dummy{}; |
| 20 |
template <typename T, typename std::enable_if<std::is_integral<T>::value, |
| 21 |
enabled>::type = dummy> |
| 22 |
class A; |
| 23 |
template <typename T> |
| 24 |
void f(A<T>*) { |
| 25 |
A<int>* map; |
| 26 |
f(map); |
| 27 |
} |