Reenable constexpr test for operator bool

This commit is contained in:
Peter Dimov
2018-04-01 00:20:26 +03:00
committed by James E. King III
parent 23cd89d4c8
commit f890fcdf66

View File

@ -125,13 +125,9 @@ int test_main(int, char*[])
char array_ands[res_ands ? 2 : 3];
BOOST_CHECK(sizeof(array_ands) / sizeof(char) == 3);
// We avoid checking the tribool::operator safe_bool(),
// because GCC-4.8 fails to evaluate it at compile-time.
// Clang compiles well.
//
// constexpr bool res_safe_bool = tribool(true); // false
// constexpr tribool xxx = (tribool(true) || tribool(indeterminate));
// static_assert(xxx, "Must be true!");
constexpr bool res_safe_bool = static_cast<bool>( tribool(true) );
constexpr tribool xxx = (tribool(true) || tribool(indeterminate));
static_assert(xxx, "Must be true!");
#endif
std::cout << "no errors detected\n";