From 207146e1e64e227c828e8088d6bb02a1c2b7e532 Mon Sep 17 00:00:00 2001 From: Simon Brand Date: Wed, 25 Oct 2017 09:27:10 +0100 Subject: [PATCH] More --- optional.hpp | 10 +--------- tests/extensions.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/optional.hpp b/optional.hpp index 57c6b74..87a0361 100644 --- a/optional.hpp +++ b/optional.hpp @@ -29,17 +29,9 @@ #endif #if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 4) -#define TL_OPTIONAL_GCC54 1 -#else -#define TL_OPTIONAL_GCC54 2 +#define TL_OPTIONAL_GCC54 #endif -template struct TC; -TC<__GNUC__> debug_1; -TC<__GNUC_MINOR__> debug_2; -TC debug_3; - - #if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9) #define TL_OPTIONAL_NO_CONSTRR #endif diff --git a/tests/extensions.cpp b/tests/extensions.cpp index d545fab..bebe426 100644 --- a/tests/extensions.cpp +++ b/tests/extensions.cpp @@ -11,6 +11,8 @@ constexpr int get_int(int) { return 42; } TL_OPTIONAL_11_CONSTEXPR tl::optional get_opt_int(int) { return 42; } +template struct TC; + // What is Clang Format up to?! TEST_CASE("Monadic operations", "[monadic]") { SECTION("map") { // lhs is empty @@ -122,8 +124,17 @@ TEST_CASE("Monadic operations", "[monadic]") { } SECTION("map constexpr") { +#if !defined(TL_OPTIONAL_GCC54) + constexpr int i = 0; +#else + constexpr int i = 1; +#endif + #if !defined(_MSC_VER) && !defined(TL_OPTIONAL_GCC49) && \ !defined(TL_OPTIONAL_GCC54) + + TC{}; + // test each overload in turn constexpr tl::optional o16 = 42; constexpr auto o16r = o16.map(get_int);