actual fix to eliminate warnings

This commit is contained in:
Alexey Ochapov 2020-11-04 01:04:12 +03:00
parent 574cd279bb
commit fe11777d78
No known key found for this signature in database
GPG Key ID: 9DC52E8F031B8DA8

View File

@ -3198,17 +3198,24 @@ FMT_CONSTEXPR basic_string_view<Char> compile_string_to_view(
return {s.data(), s.size()}; return {s.data(), s.size()};
} }
#define FMT_STRING_IMPL(s, base) \ #if defined(FMT_GCC_VERSION) && FMT_GCC_VERSION >= 400
[] { \ # define FMT_COMPILE_STRING_VISIBILITY_ATTRIBUTE \
/* Use a macro-like name to avoid shadowing warnings. */ \ __attribute__((visibility("hidden")))
struct FMT_COMPILE_STRING : base { \ #else
using char_type = fmt::remove_cvref_t<decltype(s[0])>; \ # define FMT_COMPILE_STRING_VISIBILITY_ATTRIBUTE
FMT_MAYBE_UNUSED FMT_CONSTEXPR \ #endif
operator fmt::basic_string_view<char_type>() const { \
return fmt::detail::compile_string_to_view<char_type>(s); \ #define FMT_STRING_IMPL(s, base) \
} \ [] { \
}; \ /* Use a macro-like name to avoid shadowing warnings. */ \
return FMT_COMPILE_STRING(); \ struct FMT_COMPILE_STRING_VISIBILITY_ATTRIBUTE FMT_COMPILE_STRING : base { \
using char_type = fmt::remove_cvref_t<decltype(s[0])>; \
FMT_MAYBE_UNUSED FMT_CONSTEXPR \
operator fmt::basic_string_view<char_type>() const { \
return fmt::detail::compile_string_to_view<char_type>(s); \
} \
}; \
return FMT_COMPILE_STRING(); \
}() }()
/** /**