| 1 |
// PR c++/87386 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "-fdiagnostics-show-caret" } |
| 4 |
|
| 5 |
namespace foo { |
| 6 |
template<typename> struct test { static constexpr bool value = false; }; |
| 7 |
} |
| 8 |
static_assert (foo::test<int>::value, "foo"); // { dg-error "static assertion failed: foo" } |
| 9 |
/* { dg-begin-multiline-output "" } |
| 10 |
static_assert (foo::test<int>::value, "foo"); |
| 11 |
~~~~~~~~~~~~~~~~^~~~~ |
| 12 |
{ dg-end-multiline-output "" } */ |
| 13 |
|
| 14 |
static_assert (foo::test<int>::value && true, "bar"); // { dg-error "static assertion failed: bar" } |
| 15 |
/* { dg-begin-multiline-output "" } |
| 16 |
static_assert (foo::test<int>::value && true, "bar"); |
| 17 |
~~~~~~~~~~~~~~~~^~~~~ |
| 18 |
{ dg-end-multiline-output "" } */ |