| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-g" } |
| 3 |
// Contributed by: <schmid at snake dot iap dot physik dot tu-darmstadt dot de> |
| 4 |
// and Niall Douglas <s_gccbugzilla at nedprod dot com> |
| 5 |
// PR c++/14246: ice in write_template_arg_literal while mangling boolean |
| 6 |
// expressions. |
| 7 |
|
| 8 |
namespace N1 { |
| 9 |
|
| 10 |
template <typename T> |
| 11 |
struct A { |
| 12 |
enum { Yes = (sizeof(T) == 1) }; |
| 13 |
}; |
| 14 |
|
| 15 |
template<bool T> |
| 16 |
struct B { |
| 17 |
void foo(void); |
| 18 |
}; |
| 19 |
|
| 20 |
template struct B< !A<int>::Yes >; |
| 21 |
|
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
namespace N2 { |
| 26 |
|
| 27 |
template<bool> struct A {}; |
| 28 |
A<!false> a; |
| 29 |
|
| 30 |
} |
| 31 |
|