From f890fcdf663428301e81ad28edad5bc2d3b7b5c8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 1 Apr 2018 00:20:26 +0300 Subject: [PATCH] Reenable constexpr test for operator bool --- test/tribool_test.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/tribool_test.cpp b/test/tribool_test.cpp index be8fd18..f69fddd 100644 --- a/test/tribool_test.cpp +++ b/test/tribool_test.cpp @@ -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( tribool(true) ); + constexpr tribool xxx = (tribool(true) || tribool(indeterminate)); + static_assert(xxx, "Must be true!"); #endif std::cout << "no errors detected\n";