From 0f335690db31427a006e4b5d872dd5ef8a2ebbdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Alexandre=20Boissonneault?= Date: Sat, 2 Dec 2017 20:13:08 -0500 Subject: [PATCH] Fixed compilation on "is_trivially_*" traits on GCC4.8+ --- tests/constructors.cpp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/tests/constructors.cpp b/tests/constructors.cpp index a963a2a..c164270 100644 --- a/tests/constructors.cpp +++ b/tests/constructors.cpp @@ -65,51 +65,59 @@ TEST_CASE("Constructors", "[constructors]") { tl::expected e; REQUIRE(std::is_default_constructible::value); REQUIRE(std::is_copy_constructible::value); - REQUIRE(std::is_trivially_copy_constructible::value); REQUIRE(std::is_move_constructible::value); - REQUIRE(std::is_trivially_move_constructible::value); REQUIRE(std::is_copy_assignable::value); - REQUIRE(std::is_trivially_copy_assignable::value); REQUIRE(std::is_move_assignable::value); - REQUIRE(std::is_trivially_move_assignable::value); + REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))); + REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))); +# if !defined(TL_EXPECTED_GCC49) + REQUIRE(!std::is_trivially_move_constructible::value); + REQUIRE(!std::is_trivially_move_assignable::value); +# endif } { tl::expected e; REQUIRE(std::is_default_constructible::value); REQUIRE(std::is_copy_constructible::value); - REQUIRE(!std::is_trivially_copy_constructible::value); REQUIRE(std::is_move_constructible::value); - REQUIRE(!std::is_trivially_move_constructible::value); REQUIRE(std::is_copy_assignable::value); - REQUIRE(!std::is_trivially_copy_assignable::value); REQUIRE(std::is_move_assignable::value); + REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))); + REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))); +# if !defined(TL_EXPECTED_GCC49) + REQUIRE(!std::is_trivially_move_constructible::value); REQUIRE(!std::is_trivially_move_assignable::value); +# endif } { tl::expected e; REQUIRE(std::is_default_constructible::value); REQUIRE(std::is_copy_constructible::value); - REQUIRE(!std::is_trivially_copy_constructible::value); REQUIRE(std::is_move_constructible::value); - REQUIRE(!std::is_trivially_move_constructible::value); REQUIRE(std::is_copy_assignable::value); - REQUIRE(!std::is_trivially_copy_assignable::value); REQUIRE(std::is_move_assignable::value); + REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))); + REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))); +# if !defined(TL_EXPECTED_GCC49) + REQUIRE(!std::is_trivially_move_constructible::value); REQUIRE(!std::is_trivially_move_assignable::value); +# endif } { tl::expected e; REQUIRE(std::is_default_constructible::value); REQUIRE(std::is_copy_constructible::value); - REQUIRE(!std::is_trivially_copy_constructible::value); REQUIRE(std::is_move_constructible::value); - REQUIRE(!std::is_trivially_move_constructible::value); REQUIRE(std::is_copy_assignable::value); - REQUIRE(!std::is_trivially_copy_assignable::value); REQUIRE(std::is_move_assignable::value); + REQUIRE(!IS_TRIVIALLY_COPY_CONSTRUCTIBLE(decltype(e))); + REQUIRE(!IS_TRIVIALLY_COPY_ASSIGNABLE(decltype(e))); +# if !defined(TL_EXPECTED_GCC49) + REQUIRE(!std::is_trivially_move_constructible::value); REQUIRE(!std::is_trivially_move_assignable::value); +# endif } }