| 1 |
// { dg-do assemble } |
| 2 |
// |
| 3 |
// Copyright (C) 2001 Free Software Foundation, Inc. |
| 4 |
// Contributed by Nathan Sidwell 25 April 2001 <[email protected]> |
| 5 |
// Origin:[email protected] |
| 6 |
|
| 7 |
// Bug 2559. We hadn't implemented code to mangle numbers bigger than |
| 8 |
// HOST_WIDE_INT. |
| 9 |
|
| 10 |
template<class T, T min_val, T max_val> |
| 11 |
class integer_traits_base |
| 12 |
{ |
| 13 |
public: |
| 14 |
static const bool is_integral = true; |
| 15 |
}; |
| 16 |
|
| 17 |
template<class T> |
| 18 |
class integer_traits |
| 19 |
{ |
| 20 |
public: |
| 21 |
static const bool is_integral = false; |
| 22 |
}; |
| 23 |
|
| 24 |
template<> |
| 25 |
class integer_traits<long long> |
| 26 |
: public integer_traits_base<long long, (-9223372036854775807LL - 1), |
| 27 |
9223372036854775807LL> |
| 28 |
{ }; |
| 29 |
|
| 30 |
integer_traits<long long> f; |
| 31 |
|
| 32 |
template <class T, T value> T foo () |
| 33 |
{ |
| 34 |
return value; |
| 35 |
} |
| 36 |
|
| 37 |
void x () |
| 38 |
{ |
| 39 |
foo<long long, -9223372036854775807LL> (); |
| 40 |
} |