diff --git a/include/fmt/core.h b/include/fmt/core.h index 0ea9ef43..ad037f8b 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -585,7 +585,9 @@ struct error_handler { constexpr error_handler(const error_handler&) = default; // This function is intentionally not constexpr to give a compile-time error. - FMT_NORETURN FMT_API void on_error(const char* message); + FMT_NORETURN FMT_API void on_error(const char* message) { + throw_format_error(message); + } }; FMT_END_DETAIL_NAMESPACE diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 9baf2ca1..fee13174 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -2341,12 +2341,6 @@ FMT_FUNC void report_system_error(int error_code, report_error(format_system_error, error_code, message); } -// DEPRECATED! -// This function is defined here and not inline for ABI compatiblity. -FMT_FUNC void detail::error_handler::on_error(const char* message) { - throw_format_error(message); -} - FMT_FUNC std::string vformat(string_view fmt, format_args args) { // Don't optimize the "{}" case to keep the binary size small and because it // can be better optimized in fmt::format anyway. diff --git a/include/fmt/format.h b/include/fmt/format.h index 2c4145cf..73686c40 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -132,13 +132,6 @@ FMT_END_NAMESPACE # endif #endif -// Workaround broken [[deprecated]] in the Intel, PGI and NVCC compilers. -#if FMT_ICC_VERSION || defined(__PGI) || FMT_NVCC -# define FMT_DEPRECATED_ALIAS -#else -# define FMT_DEPRECATED_ALIAS FMT_DEPRECATED -#endif - #ifndef FMT_USE_USER_DEFINED_LITERALS // EDG based compilers (Intel, NVIDIA, Elbrus, etc), GCC and MSVC support UDLs. # if (FMT_HAS_FEATURE(cxx_user_literals) || FMT_GCC_VERSION >= 407 || \ @@ -935,27 +928,6 @@ class FMT_API format_error : public std::runtime_error { ~format_error() noexcept override FMT_MSC_DEFAULT; }; -/** - \rst - Constructs a `~fmt::format_arg_store` object that contains references - to arguments and can be implicitly converted to `~fmt::format_args`. - If ``fmt`` is a compile-time string then `make_args_checked` checks - its validity at compile time. - \endrst - */ -template > -FMT_DEPRECATED FMT_INLINE auto make_args_checked( - const S& fmt, const remove_reference_t&... args) - -> format_arg_store, remove_reference_t...> { - static_assert( - detail::count<( - std::is_base_of>::value && - std::is_reference::value)...>() == 0, - "passing views as lvalues is disallowed"); - detail::check_format_string(fmt); - return {args...}; -} - namespace detail_exported { #if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS template struct fixed_string { @@ -3151,9 +3123,6 @@ struct join_view : detail::view { : begin(b), end(e), sep(s) {} }; -template -using arg_join FMT_DEPRECATED_ALIAS = join_view; - template struct formatter, Char> { private: @@ -3424,14 +3393,6 @@ inline auto format(const Locale& loc, format_string fmt, T&&... args) return vformat(loc, string_view(fmt), fmt::make_format_args(args...)); } -template -FMT_DEPRECATED auto format_to(basic_memory_buffer& buf, - format_string fmt, T&&... args) - -> appender { - detail::vformat_to(buf, string_view(fmt), fmt::make_format_args(args...)); - return appender(buf); -} - template ::value&& detail::is_locale::value)> @@ -3454,10 +3415,6 @@ FMT_INLINE auto format_to(OutputIt out, const Locale& loc, FMT_MODULE_EXPORT_END FMT_END_NAMESPACE -#ifdef FMT_DEPRECATED_INCLUDE_XCHAR -# include "xchar.h" -#endif - #ifdef FMT_HEADER_ONLY # define FMT_FUNC inline # include "format-inl.h" diff --git a/include/fmt/printf.h b/include/fmt/printf.h index 19d550f6..03a962b4 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -634,23 +634,6 @@ inline auto printf(const S& fmt, const T&... args) -> int { fmt::make_format_args>>(args...)); } -template > -FMT_DEPRECATED auto vfprintf( - std::basic_ostream& os, const S& fmt, - basic_format_args>> args) - -> int { - basic_memory_buffer buffer; - vprintf(buffer, to_string_view(fmt), args); - os.write(buffer.data(), static_cast(buffer.size())); - return static_cast(buffer.size()); -} -template > -FMT_DEPRECATED auto fprintf(std::basic_ostream& os, const S& fmt, - const T&... args) -> int { - return vfprintf(os, to_string_view(fmt), - fmt::make_format_args>(args...)); -} - FMT_MODULE_EXPORT_END FMT_END_NAMESPACE diff --git a/test/fuzzing/one-arg.cc b/test/fuzzing/one-arg.cc index 90cec716..af9787f8 100644 --- a/test/fuzzing/one-arg.cc +++ b/test/fuzzing/one-arg.cc @@ -30,8 +30,8 @@ void invoke_fmt(const uint8_t* data, size_t size) { #if FMT_FUZZ_FORMAT_TO_STRING std::string message = fmt::format(format_str.get(), *value); #else - fmt::memory_buffer message; - fmt::format_to(message, format_str.get(), *value); + auto buf = fmt::memory_buffer(); + fmt::format_to(std::back_inserter(buf), format_str.get(), *value); #endif } catch (std::exception&) { } diff --git a/test/fuzzing/two-args.cc b/test/fuzzing/two-args.cc index 979320c2..931c6465 100644 --- a/test/fuzzing/two-args.cc +++ b/test/fuzzing/two-args.cc @@ -27,8 +27,8 @@ void invoke_fmt(const uint8_t* data, size_t size) { #if FMT_FUZZ_FORMAT_TO_STRING std::string message = fmt::format(format_str, item1, item2); #else - fmt::memory_buffer message; - fmt::format_to(message, format_str, item1, item2); + auto buf = fmt::memory_buffer(); + fmt::format_to(std::back_inserter(buf), format_str, item1, item2); #endif }