From e8ef103799a7849dd8b6cd14c4c9f57645b4eef8 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 25 Jun 2017 07:49:31 -0700 Subject: [PATCH] Fix undefined-var-template warning on clang when not compiling with -std=c++11 --- fmt/format.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fmt/format.h b/fmt/format.h index 1db3d9da..fac9333a 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -107,6 +107,7 @@ typedef __int64 intmax_t; #endif #if defined(__clang__) && !defined(FMT_ICC_VERSION) +# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdocumentation-unknown-command" # pragma clang diagnostic ignored "-Wpadded" @@ -269,12 +270,8 @@ typedef __int64 intmax_t; #endif #ifndef FMT_USE_EXTERN_TEMPLATES -// Clang doesn't have a feature check for extern templates so we check -// for variadic templates which were introduced in the same version. -// For GCC according to cppreference.com they were introduced in 3.3. # define FMT_USE_EXTERN_TEMPLATES \ - ((__clang__ && FMT_USE_VARIADIC_TEMPLATES) || \ - (FMT_GCC_VERSION >= 303 && FMT_HAS_GXX_CXX11)) + (FMT_CLANG_VERSION >= 209 || (FMT_GCC_VERSION >= 303 && FMT_HAS_GXX_CXX11)) #endif #ifdef FMT_HEADER_ONLY