From 46c374a8a95eaac2a47c51393079a10a22607ef8 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 9 May 2018 20:58:05 -0700 Subject: [PATCH] Fix compilation with new gcc and -std=c++11 (#734) --- include/fmt/core.h | 4 ++-- include/fmt/format.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 2ecc043e61d0..1d5c6793ca1a 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -52,8 +52,8 @@ // GCC doesn't allow throw in constexpr until version 6 (bug 67371). #ifndef FMT_USE_CONSTEXPR # define FMT_USE_CONSTEXPR \ - (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_GCC_VERSION >= 600 || \ - FMT_MSC_VER >= 1910) + (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \ + (FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L)) #endif #if FMT_USE_CONSTEXPR # define FMT_CONSTEXPR constexpr diff --git a/include/fmt/format.h b/include/fmt/format.h index 4996aba4aa35..f0bf27af14d5 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -116,7 +116,7 @@ #endif #if FMT_USE_USER_DEFINED_LITERALS && \ - (FMT_GCC_VERSION >= 600 || \ + ((FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L) || \ (defined(FMT_CLANG_VERSION) && FMT_CLANG_VERSION >= 304)) # define FMT_UDL_TEMPLATE 1 #else