diff --git a/.travis.yml b/.travis.yml index ba0b0091..cd9e7c01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,13 @@ matrix: packages: ['clang-5.0'] env: COMPILER='clang++-5.0' CPP14=1 + - os: linux + compiler: clang + addons: + apt: + sources: *all_sources + packages: ['clang-5.0'] + env: COMPILER='clang++-5.0' CPP17=1 - os: linux compiler: clang diff --git a/src/catch2/internal/catch_compiler_capabilities.hpp b/src/catch2/internal/catch_compiler_capabilities.hpp index a4369e87..956fd13f 100644 --- a/src/catch2/internal/catch_compiler_capabilities.hpp +++ b/src/catch2/internal/catch_compiler_capabilities.hpp @@ -222,7 +222,7 @@ // Check if byte is available and usable # if __has_include() && defined(CATCH_CPP17_OR_GREATER) # include - # if __cpp_lib_byte > 0 + # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0) # define CATCH_INTERNAL_CONFIG_CPP17_BYTE # endif # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) diff --git a/src/catch2/matchers/catch_matchers_templated.hpp b/src/catch2/matchers/catch_matchers_templated.hpp index 544a2a5b..834d0b24 100644 --- a/src/catch2/matchers/catch_matchers_templated.hpp +++ b/src/catch2/matchers/catch_matchers_templated.hpp @@ -55,11 +55,11 @@ namespace Matchers { return arr; } - #ifdef CATCH_CPP17_OR_GREATER +#if defined( __cpp_lib_logical_traits ) && __cpp_lib_logical_traits >= 201510 using std::conjunction; - #else // CATCH_CPP17_OR_GREATER +#else // __cpp_lib_logical_traits template struct conjunction : std::true_type {}; @@ -67,7 +67,7 @@ namespace Matchers { template struct conjunction : std::integral_constant::value> {}; - #endif // CATCH_CPP17_OR_GREATER +#endif // __cpp_lib_logical_traits template using is_generic_matcher = std::is_base_of< diff --git a/tests/SelfTest/UsageTests/Generators.tests.cpp b/tests/SelfTest/UsageTests/Generators.tests.cpp index acfef8a9..b2154a1a 100644 --- a/tests/SelfTest/UsageTests/Generators.tests.cpp +++ b/tests/SelfTest/UsageTests/Generators.tests.cpp @@ -62,12 +62,12 @@ TEST_CASE("tables", "[generators]") { // Structured bindings make the table utility much nicer to use TEST_CASE( "strlen2", "[approvals][generators]" ) { - auto [test_input, expected] = GENERATE( table({ - {"one", 3}, - {"two", 3}, - {"three", 5}, - {"four", 4} - })); + using tuple_type = std::tuple; // see above workaround + auto [test_input, expected] = + GENERATE( table( { tuple_type{ "one", 3 }, + tuple_type{ "two", 3 }, + tuple_type{ "three", 5 }, + tuple_type{ "four", 4 } } ) ); REQUIRE( test_input.size() == expected ); } @@ -103,11 +103,9 @@ TEST_CASE( "strlen3", "[generators]" ) { static auto eatCucumbers( int start, int eat ) -> int { return start-eat; } SCENARIO("Eating cucumbers", "[generators][approvals]") { - - auto [start, eat, left] = GENERATE( table ({ - { 12, 5, 7 }, - { 20, 5, 15 } - })); + using tuple_type = std::tuple; + auto [start, eat, left] = GENERATE( table( + { tuple_type{ 12, 5, 7 }, tuple_type{ 20, 5, 15 } } ) ); GIVEN( "there are " << start << " cucumbers" ) WHEN( "I eat " << eat << " cucumbers" )