diff --git a/include/fmt/format.h b/include/fmt/format.h index ada826f3..7b52f782 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -147,20 +147,6 @@ FMT_END_NAMESPACE # endif #endif -#ifndef FMT_USE_UDL_TEMPLATE -// EDG frontend based compilers (icc, nvcc, PGI, etc) and GCC < 6.4 do not -// properly support UDL templates and GCC >= 9 warns about them. -# if FMT_USE_USER_DEFINED_LITERALS && \ - (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 501) && \ - ((FMT_GCC_VERSION >= 604 && __cplusplus >= 201402L) || \ - FMT_CLANG_VERSION >= 304) && \ - !defined(__PGI) && !defined(__NVCC__) -# define FMT_USE_UDL_TEMPLATE 1 -# else -# define FMT_USE_UDL_TEMPLATE 0 -# endif -#endif - #ifndef FMT_USE_FLOAT # define FMT_USE_FLOAT 1 #endif @@ -3995,17 +3981,6 @@ void vprint(basic_string_view format_str, wformat_args args) { #if FMT_USE_USER_DEFINED_LITERALS namespace detail { - -# if FMT_USE_UDL_TEMPLATE -template class udl_formatter { - public: - template - std::basic_string operator()(Args&&... args) const { - static FMT_CONSTEXPR_DECL Char s[] = {CHARS..., '\0'}; - return format(FMT_STRING(s), std::forward(args)...); - } -}; -# else template struct udl_formatter { basic_string_view str; @@ -4014,7 +3989,6 @@ template struct udl_formatter { return format(str, std::forward(args)...); } }; -# endif // FMT_USE_UDL_TEMPLATE template struct udl_arg { const Char* str; @@ -4026,18 +4000,6 @@ template struct udl_arg { } // namespace detail inline namespace literals { -# if FMT_USE_UDL_TEMPLATE -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# if FMT_CLANG_VERSION -# pragma GCC diagnostic ignored "-Wgnu-string-literal-operator-template" -# endif -template -constexpr detail::udl_formatter operator""_format() { - return {}; -} -# pragma GCC diagnostic pop -# else /** \rst User-defined literal equivalent of :func:`fmt::format`. @@ -4056,7 +4018,6 @@ constexpr detail::udl_formatter operator"" _format(const wchar_t* s, size_t n) { return {{s, n}}; } -# endif // FMT_USE_UDL_TEMPLATE /** \rst diff --git a/test/enforce-compile-string-test.cc b/test/enforce-compile-string-test.cc index 146e8d5e..62a4751c 100644 --- a/test/enforce-compile-string-test.cc +++ b/test/enforce-compile-string-test.cc @@ -37,14 +37,6 @@ void test_format_api() { fmt::format_to_n(wbuffer, 3, FMT_STRING(L"{}"), 12345); } -void test_literals_api() { -#if FMT_USE_UDL_TEMPLATE - using namespace fmt::literals; - "{}c{}"_format("ab", 1); - L"{}c{}"_format(L"ab", 1); -#endif -} - void test_chrono() { fmt::format(FMT_STRING("{}"), std::chrono::seconds(42)); fmt::format(FMT_STRING(L"{}"), std::chrono::seconds(42)); @@ -67,7 +59,6 @@ void test_range() { int main() { test_format_api(); - test_literals_api(); test_chrono(); test_text_style(); test_range();