Hello community, here is the log from the commit of package fmt for openSUSE:Leap:15.2 checked in at 2020-05-18 10:58:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/fmt (Old) and /work/SRC/openSUSE:Leap:15.2/.fmt.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fmt" Mon May 18 10:58:42 2020 rev:7 rq:805804 version:6.2.1 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/fmt/fmt.changes 2020-04-28 20:09:23.996315354 +0200 +++ /work/SRC/openSUSE:Leap:15.2/.fmt.new.2738/fmt.changes 2020-05-18 10:58:43.966554312 +0200 @@ -1,0 +2,13 @@ +Sat May 9 17:53:02 UTC 2020 - Luigi Baldoni <[email protected]> + +- Update to version 6.2.1 + * Fixed ostream support in ``sprintf`` + (`#1631 <https://github.com/fmtlib/fmt/issues/1631>`_). + * Fixed type detection when using implicit conversion to + ``string_view`` and ostream ``operator<<`` inconsistently + (`#1662 <https://github.com/fmtlib/fmt/issues/1662>`_). +- Drop 7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch (no longer + necessary) +- Spec cleanup + +------------------------------------------------------------------- Old: ---- 7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch fmt-6.2.0.tar.gz New: ---- fmt-6.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fmt.spec ++++++ --- /var/tmp/diff_new_pack.rOWW9P/_old 2020-05-18 10:58:44.566555553 +0200 +++ /var/tmp/diff_new_pack.rOWW9P/_new 2020-05-18 10:58:44.566555553 +0200 @@ -18,14 +18,13 @@ %define sover 6 Name: fmt -Version: 6.2.0 +Version: 6.2.1 Release: 0 Summary: A formatting library for C++ License: MIT URL: http://fmtlib.net/ Source0: https://github.com/fmtlib/fmt/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: baselibs.conf -Patch0: 7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig @@ -36,14 +35,12 @@ %package -n libfmt%{sover} Summary: A formatting library for C++ -Group: System/Libraries %description -n libfmt%{sover} Shared library for fmt, a formatting library for C++. %package devel Summary: Development files for fmt, a formatting library -Group: Development/Libraries/C and C++ Requires: libfmt%{sover} = %{version} %description devel @@ -69,11 +66,7 @@ %postun -n libfmt%{sover} -p /sbin/ldconfig %files -n libfmt%{sover} -%if 0%{?sle_version} > 120200 %license LICENSE.rst -%else -%doc LICENSE.rst -%endif %{_libdir}/libfmt.so.%{sover}* %files devel ++++++ fmt-6.2.0.tar.gz -> fmt-6.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fmt-6.2.0/ChangeLog.rst new/fmt-6.2.1/ChangeLog.rst --- old/fmt-6.2.0/ChangeLog.rst 2020-04-05 15:46:41.000000000 +0200 +++ new/fmt-6.2.1/ChangeLog.rst 2020-05-09 18:13:20.000000000 +0200 @@ -1,3 +1,13 @@ +6.2.1 - 2020-05-09 +------------------ + +* Fixed ostream support in ``sprintf`` + (`#1631 <https://github.com/fmtlib/fmt/issues/1631>`_). + +* Fixed type detection when using implicit conversion to ``string_view`` and + ostream ``operator<<`` inconsistently + (`#1662 <https://github.com/fmtlib/fmt/issues/1662>`_). + 6.2.0 - 2020-04-05 ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fmt-6.2.0/doc/build.py new/fmt-6.2.1/doc/build.py --- old/fmt-6.2.0/doc/build.py 2020-04-05 15:46:41.000000000 +0200 +++ new/fmt-6.2.1/doc/build.py 2020-05-09 18:13:20.000000000 +0200 @@ -6,7 +6,7 @@ from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE from distutils.version import LooseVersion -versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0'] +versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0', '6.2.1'] def pip_install(package, commit=None, **kwargs): "Install package using pip." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fmt-6.2.0/include/fmt/core.h new/fmt-6.2.1/include/fmt/core.h --- old/fmt-6.2.0/include/fmt/core.h 2020-04-05 15:46:41.000000000 +0200 +++ new/fmt-6.2.1/include/fmt/core.h 2020-05-09 18:13:20.000000000 +0200 @@ -18,7 +18,7 @@ #include <vector> // The fmt library version in the form major * 10000 + minor * 100 + patch. -#define FMT_VERSION 60200 +#define FMT_VERSION 60201 #ifdef __has_feature # define FMT_HAS_FEATURE(x) __has_feature(x) @@ -830,7 +830,8 @@ template <typename Context> struct custom_value { using parse_context = basic_format_parse_context<typename Context::char_type>; const void* value; - void (*format)(const void* arg, parse_context& parse_ctx, Context& ctx); + void (*format)(const void* arg, + typename Context::parse_context_type& parse_ctx, Context& ctx); }; // A formatting argument value. @@ -890,9 +891,9 @@ private: // Formats an argument of a custom type, such as a user-defined class. template <typename T, typename Formatter> - static void format_custom_arg( - const void* arg, basic_format_parse_context<char_type>& parse_ctx, - Context& ctx) { + static void format_custom_arg(const void* arg, + typename Context::parse_context_type& parse_ctx, + Context& ctx) { Formatter f; parse_ctx.advance_to(f.parse(parse_ctx)); ctx.advance_to(f.format(*static_cast<const T*>(arg), ctx)); @@ -1061,7 +1062,7 @@ public: explicit handle(internal::custom_value<Context> custom) : custom_(custom) {} - void format(basic_format_parse_context<char_type>& parse_ctx, + void format(typename Context::parse_context_type& parse_ctx, Context& ctx) const { custom_.format(custom_.value, parse_ctx, ctx); } @@ -1207,13 +1208,16 @@ return arg; } -template <bool IS_PACKED, typename Context, typename T, +// The type template parameter is there to avoid an ODR violation when using +// a fallback formatter in one translation unit and an implicit conversion in +// another (not recommended). +template <bool IS_PACKED, typename Context, type, typename T, FMT_ENABLE_IF(IS_PACKED)> inline value<Context> make_arg(const T& val) { return arg_mapper<Context>().map(val); } -template <bool IS_PACKED, typename Context, typename T, +template <bool IS_PACKED, typename Context, type, typename T, FMT_ENABLE_IF(!IS_PACKED)> inline basic_format_arg<Context> make_arg(const T& value) { return make_arg<Context>(value); @@ -1272,6 +1276,7 @@ public: using iterator = OutputIt; using format_arg = basic_format_arg<basic_format_context>; + using parse_context_type = basic_format_parse_context<Char>; template <typename T> using formatter_type = formatter<T, char_type>; basic_format_context(const basic_format_context&) = delete; @@ -1346,7 +1351,9 @@ #if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 basic_format_args<Context>(*this), #endif - data_{internal::make_arg<is_packed, Context>(args)...} { + data_{internal::make_arg< + is_packed, Context, + internal::mapped_type_constant<Args, Context>::value>(args)...} { } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fmt-6.2.0/include/fmt/ostream.h new/fmt-6.2.1/include/fmt/ostream.h --- old/fmt-6.2.0/include/fmt/ostream.h 2020-04-05 15:46:41.000000000 +0200 +++ new/fmt-6.2.1/include/fmt/ostream.h 2020-05-09 18:13:20.000000000 +0200 @@ -9,9 +9,14 @@ #define FMT_OSTREAM_H_ #include <ostream> + #include "format.h" FMT_BEGIN_NAMESPACE + +template <typename CHar> class basic_printf_parse_context; +template <typename OutputIt, typename Char> class basic_printf_context; + namespace internal { template <class Char> class formatbuf : public std::basic_streambuf<Char> { @@ -93,9 +98,9 @@ locale_ref loc = locale_ref()) { formatbuf<Char> format_buf(buf); std::basic_ostream<Char> output(&format_buf); - #if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) +#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) if (loc) output.imbue(loc.get<std::locale>()); - #endif +#endif output.exceptions(std::ios_base::failbit | std::ios_base::badbit); output << value; buf.resize(buf.size()); @@ -104,14 +109,32 @@ // Formats an object of type T that has an overloaded ostream operator<<. template <typename T, typename Char> struct fallback_formatter<T, Char, enable_if_t<is_streamable<T, Char>::value>> - : formatter<basic_string_view<Char>, Char> { - template <typename Context> - auto format(const T& value, Context& ctx) -> decltype(ctx.out()) { + : private formatter<basic_string_view<Char>, Char> { + auto parse(basic_format_parse_context<Char>& ctx) -> decltype(ctx.begin()) { + return formatter<basic_string_view<Char>, Char>::parse(ctx); + } + template <typename ParseCtx, + FMT_ENABLE_IF(std::is_same< + ParseCtx, basic_printf_parse_context<Char>>::value)> + auto parse(ParseCtx& ctx) -> decltype(ctx.begin()) { + return ctx.begin(); + } + + template <typename OutputIt> + auto format(const T& value, basic_format_context<OutputIt, Char>& ctx) + -> OutputIt { basic_memory_buffer<Char> buffer; format_value(buffer, value, ctx.locale()); basic_string_view<Char> str(buffer.data(), buffer.size()); return formatter<basic_string_view<Char>, Char>::format(str, ctx); } + template <typename OutputIt> + auto format(const T& value, basic_printf_context<OutputIt, Char>& ctx) + -> OutputIt { + basic_memory_buffer<Char> buffer; + format_value(buffer, value, ctx.locale()); + return std::copy(buffer.begin(), buffer.end(), ctx.out()); + } }; } // namespace internal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fmt-6.2.0/include/fmt/printf.h new/fmt-6.2.1/include/fmt/printf.h --- old/fmt-6.2.0/include/fmt/printf.h 2020-04-05 15:46:41.000000000 +0200 +++ new/fmt-6.2.1/include/fmt/printf.h 2020-05-09 18:13:20.000000000 +0200 @@ -189,6 +189,10 @@ template <typename Range> class printf_arg_formatter; +template <typename Char> +class basic_printf_parse_context : public basic_format_parse_context<Char> { + using basic_format_parse_context<Char>::basic_format_parse_context; +}; template <typename OutputIt, typename Char> class basic_printf_context; /** @@ -324,6 +328,7 @@ using char_type = Char; using iterator = OutputIt; using format_arg = basic_format_arg<basic_printf_context>; + using parse_context_type = basic_printf_parse_context<Char>; template <typename T> using formatter_type = printf_formatter<T>; private: @@ -331,7 +336,7 @@ OutputIt out_; basic_format_args<basic_printf_context> args_; - basic_format_parse_context<Char> parse_ctx_; + parse_context_type parse_ctx_; static void parse_flags(format_specs& specs, const Char*& it, const Char* end); @@ -362,7 +367,7 @@ format_arg arg(int id) const { return args_.get(id); } - basic_format_parse_context<Char>& parse_context() { return parse_ctx_; } + parse_context_type& parse_context() { return parse_ctx_; } FMT_CONSTEXPR void on_error(const char* message) { parse_ctx_.on_error(message); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fmt-6.2.0/test/core-test.cc new/fmt-6.2.1/test/core-test.cc --- old/fmt-6.2.0/test/core-test.cc 2020-04-05 15:46:41.000000000 +0200 +++ new/fmt-6.2.1/test/core-test.cc 2020-05-09 18:13:20.000000000 +0200 @@ -210,7 +210,8 @@ } struct custom_context { - typedef char char_type; + using char_type = char; + using parse_context_type = fmt::format_parse_context; template <typename T> struct formatter_type { template <typename ParseContext> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fmt-6.2.0/test/format-test.cc new/fmt-6.2.1/test/format-test.cc --- old/fmt-6.2.0/test/format-test.cc 2020-04-05 15:46:41.000000000 +0200 +++ new/fmt-6.2.1/test/format-test.cc 2020-05-09 18:13:20.000000000 +0200 @@ -2259,8 +2259,9 @@ }; struct test_context { - typedef char char_type; - typedef fmt::basic_format_arg<test_context> format_arg; + using char_type = char; + using format_arg = fmt::basic_format_arg<test_context>; + using parse_context_type = fmt::format_parse_context; template <typename T> struct formatter_type { typedef fmt::formatter<T, char_type> type; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fmt-6.2.0/test/printf-test.cc new/fmt-6.2.1/test/printf-test.cc --- old/fmt-6.2.0/test/printf-test.cc 2020-04-05 15:46:41.000000000 +0200 +++ new/fmt-6.2.1/test/printf-test.cc 2020-05-09 18:13:20.000000000 +0200 @@ -502,9 +502,7 @@ TEST(PrintfTest, WideString) { EXPECT_EQ(L"abc", fmt::sprintf(L"%s", L"abc")); } TEST(PrintfTest, PrintfCustom) { - // The test is disabled for now because it requires decoupling - // fallback_formatter::format from format_context. - //EXPECT_EQ("abc", test_sprintf("%s", TestString("abc"))); + EXPECT_EQ("abc", test_sprintf("%s", TestString("abc"))); } TEST(PrintfTest, OStream) {
