| 1 |
// PR c++/65882 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "-Wbool-compare" } |
| 4 |
|
| 5 |
// Check that we don't ICE because of reentering error reporting routines while |
| 6 |
// evaluating template parameters |
| 7 |
|
| 8 |
template<typename> |
| 9 |
struct type_function { |
| 10 |
static constexpr bool value = false; |
| 11 |
}; |
| 12 |
|
| 13 |
template<bool> |
| 14 |
struct dependent_type { |
| 15 |
typedef int type; |
| 16 |
}; |
| 17 |
|
| 18 |
template<typename T> |
| 19 |
typename dependent_type<(5 > type_function<T>::value)>::type |
| 20 |
bar(); |
| 21 |
|
| 22 |
template<typename T> |
| 23 |
typename dependent_type<(5 > type_function<T>::value)>::type |
| 24 |
foo() |
| 25 |
{ |
| 26 |
return bar<int>(); |
| 27 |
} |
| 28 |
|
| 29 |
int main() |
| 30 |
{ |
| 31 |
foo<int>(); |
| 32 |
} |