mpusz / mp-units

The quantities and units library for C++
https://mpusz.github.io/mp-units/
MIT License
1.05k stars 83 forks source link

Can't compile with fmt v11.0.2 #602

Open nebkat opened 3 weeks ago

nebkat commented 3 weeks ago

Getting these errors since upgrading to fmtlib v11.0.2.

In file included from /proj/main.hpp:6,
                 from /proj/main.cpp:3:
/proj/mp-units/src/core/include/mp-units/format.h: In instantiation of 'decltype (ctx.out()) formatter<T, Char>::format(const U&, FormatContext&) const [with FormatContext = fmt::v11::context; U = mp_units::si::degree_Celsius; Char = char; decltype (ctx.out()) = fmt::v11::basic_appender<char>]':
/proj/fmt/include/fmt/base.h:1402:29:   required from 'static void fmt::v11::detail::value<Context>::format_custom_arg(void*, typename Context::parse_context_type&, Context&) [with T = mp_units::si::degree_Celsius; Formatter = fmt::v11::formatter<mp_units::si::degree_Celsius, char, void>; Context = fmt::v11::context; typename Context::parse_context_type = fmt::v11::basic_format_parse_context<char>]'
/proj/fmt/include/fmt/base.h:1383:19:   required from 'constexpr fmt::v11::detail::value<Context>::value(T&) [with T = const mp_units::si::degree_Celsius; Context = fmt::v11::context]'
/proj/mp-units/src/core/include/mp-units/format.h:453:3:   required from 'OutputIt fmt::v11::formatter<mp_units::quantity<R, Rep>, Char>::format_quantity(OutputIt, const quantity_t&, FormatContext&) const [with OutputIt = fmt::v11::basic_appender<char>; FormatContext = fmt::v11::context; auto Reference = mp_units::si::degree_Celsius(); Rep = float; Char = char; quantity_t = mp_units::quantity<mp_units::si::degree_Celsius(), float>]'
/proj/mp-units/src/core/include/mp-units/format.h:478:22:   required from 'auto fmt::v11::formatter<mp_units::quantity<R, Rep>, Char>::format(const quantity_t&, FormatContext&) const [with FormatContext = fmt::v11::context; auto Reference = mp_units::si::degree_Celsius(); Rep = float; Char = char; quantity_t = mp_units::quantity<mp_units::si::degree_Celsius(), float>]'
/proj/fmt/include/fmt/base.h:1224:70:   [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/proj/fmt/include/fmt/base.h:1523:69:   required from 'struct fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<const mp_units::quantity<mp_units::si::degree_Celsius(), float>, mp_units::quantity<mp_units::si::degree_Celsius(), float> >'
/proj/fmt/include/fmt/base.h:1531:25:   required by substitution of 'template<class T, typename std::enable_if<(! fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<T, typename std::remove_const<_Tp>::type>::value), int>::type <anonymous> > constexpr fmt::v11::detail::unformattable fmt::v11::detail::arg_mapper<fmt::v11::context>::do_map(T&) [with T = const mp_units::quantity<mp_units::si::degree_Celsius(), float>; typename std::enable_if<(! fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<T, typename std::remove_const<_Tp>::type>::value), int>::type <anonymous> = <missing>]'
/proj/fmt/include/fmt/base.h:1544:68:   required by substitution of 'template<class T, class U, typename std::enable_if<((((((((std::is_class<U>::value || std::is_enum<_Tp2>::value) || std::is_union<U>::value) || std::is_fundamental<U>::value) && (! fmt::v11::detail::has_to_string_view<U, void>::value)) && (! fmt::v11::is_char<U>::value)) && (! fmt::v11::detail::is_named_arg<T>::value)) && (! std::is_integral<_Size>::value)) && (! std::is_arithmetic<typename fmt::v11::detail::format_as_result<U>::type>::value)), int>::type <anonymous> > constexpr decltype (((fmt::v11::detail::arg_mapper<fmt::v11::context>*)this)->fmt::v11::detail::arg_mapper<fmt::v11::context>::do_map(val)) fmt::v11::detail::arg_mapper<fmt::v11::context>::map(T&) [with T = const mp_units::quantity<mp_units::si::degree_Celsius(), float>; U = mp_units::quantity<mp_units::si::degree_Celsius(), float>; typename std::enable_if<((((((((std::is_class<U>::value || std::is_enum<_Tp2>::value) || std::is_union<U>::value) || std::is_fundamental<U>::value) && (! fmt::v11::detail::has_to_string_view<U, void>::value)) && (! fmt::v11::is_char<U>::value)) && (! fmt::v11::detail::is_named_arg<T>::value)) && (! std::is_integral<_Size>::value)) && (! std::is_arithmetic<typename fmt::v11::detail::format_as_result<U>::type>::value)), int>::type <anonymous> = 0]'
/proj/fmt/include/fmt/base.h:1560:53:   required by substitution of 'template<class T, class Context> using fmt::v11::detail::mapped_type_constant = fmt::v11::detail::type_constant<decltype (fmt::v11::detail::arg_mapper<Context>().map(declval<const T&>())), typename Context::char_type> [with T = mp_units::quantity<mp_units::si::degree_Celsius(), float>; Context = fmt::v11::context]'
/proj/fmt/include/fmt/base.h:2733:68:   required from 'constexpr fmt::v11::detail::format_string_checker<Char, Args>::format_string_checker(fmt::v11::basic_string_view<Char>) [with Char = char; Args = {char*, const char*, mp_units::quantity<mp_units::si::degree_Celsius(), float>}]'
/proj/main.cpp:14:5:   required from here
/proj/mp-units/src/core/include/mp-units/format.h:247:44: error: no matching function for call to 'unit_symbol_to<char>(fmt::v11::context::iterator, const mp_units::si::degree_Celsius&, fmt::v11::formatter<mp_units::si::degree_Celsius, char, void>::format_specs&)'
  247 |       return mp_units::unit_symbol_to<Char>(ctx.out(), u, specs);
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /proj/mp-units/src/core/include/mp-units/bits/sudo_cast.h:29,
                 from /proj/mp-units/src/core/include/mp-units/framework/quantity.h:28,
                 from /proj/mp-units/src/systems/include/mp-units/systems/isq/base_quantities.h:29,
                 from /proj/mp-units/src/systems/include/mp-units/systems/isq/si_quantities.h:28,
                 from /proj/mp-units/src/systems/include/mp-units/systems/isq/atomic_and_nuclear_physics.h:28,
                 from /proj/mp-units/src/systems/include/mp-units/systems/isq.h:26,
                 from /proj/main.hpp:4:
/proj/mp-units/src/core/include/mp-units/framework/unit.h:807:15: note: candidate: 'template<class CharT, class Out, class U>  requires (output_iterator<Out, CharT>) && (Unit<U>) constexpr Out mp_units::unit_symbol_to(Out, U, const unit_symbol_formatting&)'
  807 | constexpr Out unit_symbol_to(Out out, U u, const unit_symbol_formatting& fmt = unit_symbol_formatting{})
      |               ^~~~~~~~~~~~~~
/proj/mp-units/src/core/include/mp-units/framework/unit.h:807:15: note:   template argument deduction/substitution failed:
/proj/mp-units/src/core/include/mp-units/framework/unit.h:807:15: note: constraints not satisfied
In file included from /home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/stl_iterator_base_types.h:71,
                 from /home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/stl_algobase.h:65,
                 from /home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/specfun.h:43,
                 from /home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/cmath:3699,
                 from /proj/fmt/include/fmt/format.h:44,
                 from /proj/troo-idf-cxx/common/include/common/fmt_log.hpp:4,
                 from /proj/main.cpp:1:
/home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/iterator_concepts.h: In substitution of 'template<class CharT, class Out, class U>  requires (output_iterator<Out, CharT>) && (Unit<U>) constexpr Out mp_units::unit_symbol_to(Out, U, const unit_symbol_formatting&) [with CharT = char; Out = fmt::v11::basic_appender<char>; U = mp_units::si::degree_Celsius]':
/proj/mp-units/src/core/include/mp-units/format.h:247:44:   required from 'decltype (ctx.out()) formatter<T, Char>::format(const U&, FormatContext&) const [with FormatContext = fmt::v11::context; U = mp_units::si::degree_Celsius; Char = char; decltype (ctx.out()) = fmt::v11::basic_appender<char>]'
/proj/fmt/include/fmt/base.h:1402:29:   required from 'static void fmt::v11::detail::value<Context>::format_custom_arg(void*, typename Context::parse_context_type&, Context&) [with T = mp_units::si::degree_Celsius; Formatter = fmt::v11::formatter<mp_units::si::degree_Celsius, char, void>; Context = fmt::v11::context; typename Context::parse_context_type = fmt::v11::basic_format_parse_context<char>]'
/proj/fmt/include/fmt/base.h:1383:19:   required from 'constexpr fmt::v11::detail::value<Context>::value(T&) [with T = const mp_units::si::degree_Celsius; Context = fmt::v11::context]'
/proj/mp-units/src/core/include/mp-units/format.h:453:3:   required from 'OutputIt fmt::v11::formatter<mp_units::quantity<R, Rep>, Char>::format_quantity(OutputIt, const quantity_t&, FormatContext&) const [with OutputIt = fmt::v11::basic_appender<char>; FormatContext = fmt::v11::context; auto Reference = mp_units::si::degree_Celsius(); Rep = float; Char = char; quantity_t = mp_units::quantity<mp_units::si::degree_Celsius(), float>]'
/proj/mp-units/src/core/include/mp-units/format.h:478:22:   required from 'auto fmt::v11::formatter<mp_units::quantity<R, Rep>, Char>::format(const quantity_t&, FormatContext&) const [with FormatContext = fmt::v11::context; auto Reference = mp_units::si::degree_Celsius(); Rep = float; Char = char; quantity_t = mp_units::quantity<mp_units::si::degree_Celsius(), float>]'
/proj/fmt/include/fmt/base.h:1224:70:   [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/proj/fmt/include/fmt/base.h:1523:69:   required from 'struct fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<const mp_units::quantity<mp_units::si::degree_Celsius(), float>, mp_units::quantity<mp_units::si::degree_Celsius(), float> >'
/proj/fmt/include/fmt/base.h:1531:25:   required by substitution of 'template<class T, typename std::enable_if<(! fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<T, typename std::remove_const<_Tp>::type>::value), int>::type <anonymous> > constexpr fmt::v11::detail::unformattable fmt::v11::detail::arg_mapper<fmt::v11::context>::do_map(T&) [with T = const mp_units::quantity<mp_units::si::degree_Celsius(), float>; typename std::enable_if<(! fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<T, typename std::remove_const<_Tp>::type>::value), int>::type <anonymous> = <missing>]'
/proj/fmt/include/fmt/base.h:1544:68:   required by substitution of 'template<class T, class U, typename std::enable_if<((((((((std::is_class<U>::value || std::is_enum<_Tp2>::value) || std::is_union<U>::value) || std::is_fundamental<U>::value) && (! fmt::v11::detail::has_to_string_view<U, void>::value)) && (! fmt::v11::is_char<U>::value)) && (! fmt::v11::detail::is_named_arg<T>::value)) && (! std::is_integral<_Size>::value)) && (! std::is_arithmetic<typename fmt::v11::detail::format_as_result<U>::type>::value)), int>::type <anonymous> > constexpr decltype (((fmt::v11::detail::arg_mapper<fmt::v11::context>*)this)->fmt::v11::detail::arg_mapper<fmt::v11::context>::do_map(val)) fmt::v11::detail::arg_mapper<fmt::v11::context>::map(T&) [with T = const mp_units::quantity<mp_units::si::degree_Celsius(), float>; U = mp_units::quantity<mp_units::si::degree_Celsius(), float>; typename std::enable_if<((((((((std::is_class<U>::value || std::is_enum<_Tp2>::value) || std::is_union<U>::value) || std::is_fundamental<U>::value) && (! fmt::v11::detail::has_to_string_view<U, void>::value)) && (! fmt::v11::is_char<U>::value)) && (! fmt::v11::detail::is_named_arg<T>::value)) && (! std::is_integral<_Size>::value)) && (! std::is_arithmetic<typename fmt::v11::detail::format_as_result<U>::type>::value)), int>::type <anonymous> = 0]'
/proj/fmt/include/fmt/base.h:1560:53:   required by substitution of 'template<class T, class Context> using fmt::v11::detail::mapped_type_constant = fmt::v11::detail::type_constant<decltype (fmt::v11::detail::arg_mapper<Context>().map(declval<const T&>())), typename Context::char_type> [with T = mp_units::quantity<mp_units::si::degree_Celsius(), float>; Context = fmt::v11::context]'
/proj/fmt/include/fmt/base.h:2733:68:   required from 'constexpr fmt::v11::detail::format_string_checker<Char, Args>::format_string_checker(fmt::v11::basic_string_view<Char>) [with Char = char; Args = {char*, const char*, mp_units::quantity<mp_units::si::degree_Celsius(), float>}]'
/proj/main.cpp:14:5:   required from here
/home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/iterator_concepts.h:620:13:   required for the satisfaction of 'weakly_incrementable<_Iter>' [with _Iter = fmt::v11::basic_appender<char>]
/home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/iterator_concepts.h:634:13:   required for the satisfaction of 'input_or_output_iterator<_Iter>' [with _Iter = fmt::v11::basic_appender<char>]
/home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/iterator_concepts.h:662:13:   required for the satisfaction of 'output_iterator<Out, CharT>' [with Out = fmt::v11::basic_appender<char>; CharT = char]
/home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/iterator_concepts.h:621:10:   in requirements with '_Iter __i' [with _Iter = fmt::v11::basic_appender<char>]
/home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/iterator_concepts.h:623:18: note: the required type 'std::iter_difference_t<_Iter>' is invalid
  623 |         typename iter_difference_t<_Iter>;
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/iterator_concepts.h:624:18: note: nested requirement '__is_signed_integer_like<typename std::__detail::__iter_traits_impl<typename std::remove_cvref<_Tp>::type, std::incrementable_traits<typename std::remove_cvref<_Tp>::type> >::type::difference_type>' is not satisfied
  624 |         requires __detail::__is_signed_integer_like<iter_difference_t<_Iter>>;
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/proj/mp-units/src/core/include/mp-units/format.h: In instantiation of 'decltype (ctx.out()) formatter<T, Char>::format(const U&, FormatContext&) const [with FormatContext = fmt::v11::context; U = mp_units::si::degree_Celsius; Char = char; decltype (ctx.out()) = fmt::v11::basic_appender<char>]':
/proj/fmt/include/fmt/base.h:1402:29:   required from 'static void fmt::v11::detail::value<Context>::format_custom_arg(void*, typename Context::parse_context_type&, Context&) [with T = mp_units::si::degree_Celsius; Formatter = fmt::v11::formatter<mp_units::si::degree_Celsius, char, void>; Context = fmt::v11::context; typename Context::parse_context_type = fmt::v11::basic_format_parse_context<char>]'
/proj/fmt/include/fmt/base.h:1383:19:   required from 'constexpr fmt::v11::detail::value<Context>::value(T&) [with T = const mp_units::si::degree_Celsius; Context = fmt::v11::context]'
/proj/mp-units/src/core/include/mp-units/format.h:453:3:   required from 'OutputIt fmt::v11::formatter<mp_units::quantity<R, Rep>, Char>::format_quantity(OutputIt, const quantity_t&, FormatContext&) const [with OutputIt = fmt::v11::basic_appender<char>; FormatContext = fmt::v11::context; auto Reference = mp_units::si::degree_Celsius(); Rep = float; Char = char; quantity_t = mp_units::quantity<mp_units::si::degree_Celsius(), float>]'
/proj/mp-units/src/core/include/mp-units/format.h:478:22:   required from 'auto fmt::v11::formatter<mp_units::quantity<R, Rep>, Char>::format(const quantity_t&, FormatContext&) const [with FormatContext = fmt::v11::context; auto Reference = mp_units::si::degree_Celsius(); Rep = float; Char = char; quantity_t = mp_units::quantity<mp_units::si::degree_Celsius(), float>]'
/proj/fmt/include/fmt/base.h:1224:70:   [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/proj/fmt/include/fmt/base.h:1523:69:   required from 'struct fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<const mp_units::quantity<mp_units::si::degree_Celsius(), float>, mp_units::quantity<mp_units::si::degree_Celsius(), float> >'
/proj/fmt/include/fmt/base.h:1531:25:   required by substitution of 'template<class T, typename std::enable_if<(! fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<T, typename std::remove_const<_Tp>::type>::value), int>::type <anonymous> > constexpr fmt::v11::detail::unformattable fmt::v11::detail::arg_mapper<fmt::v11::context>::do_map(T&) [with T = const mp_units::quantity<mp_units::si::degree_Celsius(), float>; typename std::enable_if<(! fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<T, typename std::remove_const<_Tp>::type>::value), int>::type <anonymous> = <missing>]'
/proj/fmt/include/fmt/base.h:1544:68:   required by substitution of 'template<class T, class U, typename std::enable_if<((((((((std::is_class<U>::value || std::is_enum<_Tp2>::value) || std::is_union<U>::value) || std::is_fundamental<U>::value) && (! fmt::v11::detail::has_to_string_view<U, void>::value)) && (! fmt::v11::is_char<U>::value)) && (! fmt::v11::detail::is_named_arg<T>::value)) && (! std::is_integral<_Size>::value)) && (! std::is_arithmetic<typename fmt::v11::detail::format_as_result<U>::type>::value)), int>::type <anonymous> > constexpr decltype (((fmt::v11::detail::arg_mapper<fmt::v11::context>*)this)->fmt::v11::detail::arg_mapper<fmt::v11::context>::do_map(val)) fmt::v11::detail::arg_mapper<fmt::v11::context>::map(T&) [with T = const mp_units::quantity<mp_units::si::degree_Celsius(), float>; U = mp_units::quantity<mp_units::si::degree_Celsius(), float>; typename std::enable_if<((((((((std::is_class<U>::value || std::is_enum<_Tp2>::value) || std::is_union<U>::value) || std::is_fundamental<U>::value) && (! fmt::v11::detail::has_to_string_view<U, void>::value)) && (! fmt::v11::is_char<U>::value)) && (! fmt::v11::detail::is_named_arg<T>::value)) && (! std::is_integral<_Size>::value)) && (! std::is_arithmetic<typename fmt::v11::detail::format_as_result<U>::type>::value)), int>::type <anonymous> = 0]'
/proj/fmt/include/fmt/base.h:1560:53:   required by substitution of 'template<class T, class Context> using fmt::v11::detail::mapped_type_constant = fmt::v11::detail::type_constant<decltype (fmt::v11::detail::arg_mapper<Context>().map(declval<const T&>())), typename Context::char_type> [with T = mp_units::quantity<mp_units::si::degree_Celsius(), float>; Context = fmt::v11::context]'
/proj/fmt/include/fmt/base.h:2733:68:   required from 'constexpr fmt::v11::detail::format_string_checker<Char, Args>::format_string_checker(fmt::v11::basic_string_view<Char>) [with Char = char; Args = {char*, const char*, mp_units::quantity<mp_units::si::degree_Celsius(), float>}]'
/proj/main.cpp:14:5:   required from here
cc1plus: note: set '-fconcepts-diagnostics-depth=' to at least 2 for more detail
/proj/mp-units/src/core/include/mp-units/format.h: In instantiation of 'decltype (ctx.out()) formatter<T, Char>::format(const U&, FormatContext&) const [with FormatContext = fmt::v11::context; U = mp_units::si::pico_<mp_units::si::farad>; Char = char; decltype (ctx.out()) = fmt::v11::basic_appender<char>]':
/proj/fmt/include/fmt/base.h:1402:29:   required from 'static void fmt::v11::detail::value<Context>::format_custom_arg(void*, typename Context::parse_context_type&, Context&) [with T = mp_units::si::pico_<mp_units::si::farad>; Formatter = fmt::v11::formatter<mp_units::si::pico_<mp_units::si::farad>, char, void>; Context = fmt::v11::context; typename Context::parse_context_type = fmt::v11::basic_format_parse_context<char>]'
/proj/fmt/include/fmt/base.h:1383:19:   required from 'constexpr fmt::v11::detail::value<Context>::value(T&) [with T = const mp_units::si::pico_<mp_units::si::farad>; Context = fmt::v11::context]'
/proj/mp-units/src/core/include/mp-units/format.h:453:3:   required from 'OutputIt fmt::v11::formatter<mp_units::quantity<R, Rep>, Char>::format_quantity(OutputIt, const quantity_t&, FormatContext&) const [with OutputIt = fmt::v11::basic_appender<char>; FormatContext = fmt::v11::context; auto Reference = mp_units::si::pico_<mp_units::si::farad>(); Rep = float; Char = char; quantity_t = mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float>]'
/proj/mp-units/src/core/include/mp-units/format.h:478:22:   required from 'auto fmt::v11::formatter<mp_units::quantity<R, Rep>, Char>::format(const quantity_t&, FormatContext&) const [with FormatContext = fmt::v11::context; auto Reference = mp_units::si::pico_<mp_units::si::farad>(); Rep = float; Char = char; quantity_t = mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float>]'
/proj/fmt/include/fmt/base.h:1224:70:   [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/proj/fmt/include/fmt/base.h:1523:69:   required from 'struct fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<const mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float>, mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float> >'
/proj/fmt/include/fmt/base.h:1531:25:   required by substitution of 'template<class T, typename std::enable_if<(! fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<T, typename std::remove_const<_Tp>::type>::value), int>::type <anonymous> > constexpr fmt::v11::detail::unformattable fmt::v11::detail::arg_mapper<fmt::v11::context>::do_map(T&) [with T = const mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float>; typename std::enable_if<(! fmt::v11::detail::arg_mapper<fmt::v11::context>::formattable<T, typename std::remove_const<_Tp>::type>::value), int>::type <anonymous> = <missing>]'
/proj/fmt/include/fmt/base.h:1544:68:   required by substitution of 'template<class T, class U, typename std::enable_if<((((((((std::is_class<U>::value || std::is_enum<_Tp2>::value) || std::is_union<U>::value) || std::is_fundamental<U>::value) && (! fmt::v11::detail::has_to_string_view<U, void>::value)) && (! fmt::v11::is_char<U>::value)) && (! fmt::v11::detail::is_named_arg<T>::value)) && (! std::is_integral<_Size>::value)) && (! std::is_arithmetic<typename fmt::v11::detail::format_as_result<U>::type>::value)), int>::type <anonymous> > constexpr decltype (((fmt::v11::detail::arg_mapper<fmt::v11::context>*)this)->fmt::v11::detail::arg_mapper<fmt::v11::context>::do_map(val)) fmt::v11::detail::arg_mapper<fmt::v11::context>::map(T&) [with T = const mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float>; U = mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float>; typename std::enable_if<((((((((std::is_class<U>::value || std::is_enum<_Tp2>::value) || std::is_union<U>::value) || std::is_fundamental<U>::value) && (! fmt::v11::detail::has_to_string_view<U, void>::value)) && (! fmt::v11::is_char<U>::value)) && (! fmt::v11::detail::is_named_arg<T>::value)) && (! std::is_integral<_Size>::value)) && (! std::is_arithmetic<typename fmt::v11::detail::format_as_result<U>::type>::value)), int>::type <anonymous> = 0]'
/proj/fmt/include/fmt/base.h:1560:53:   required by substitution of 'template<class T, class Context> using fmt::v11::detail::mapped_type_constant = fmt::v11::detail::type_constant<decltype (fmt::v11::detail::arg_mapper<Context>().map(declval<const T&>())), typename Context::char_type> [with T = mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float>; Context = fmt::v11::context]'
/proj/fmt/include/fmt/base.h:2733:68:   required from 'constexpr fmt::v11::detail::format_string_checker<Char, Args>::format_string_checker(fmt::v11::basic_string_view<Char>) [with Char = char; Args = {char*, const char*, mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float>, mp_units::quantity<mp_units::si::pico_<mp_units::si::farad>(), float>}]'

Not sure if related: Compiler explorer fmt v11.0.0 Compiler explorer fmt trunk

libc++abi: terminating due to uncaught exception of type fmt::v11::format_error: width/precision is not integer
Program terminated with signal: SIGSEGV
mpusz commented 3 weeks ago

It seems that the fmt::basic_appender<char> does not satisfy input_or_output_iterator on fmt 11.0.2.

Could you please check if it reproduces with the latest fmt version? I could not reproduce it for the fmt master version on the Compiler Explorer (https://godbolt.org/z/beGoznE1P).

lbonn commented 5 days ago

It has since be fixed in https://github.com/fmtlib/fmt/pull/4093. On the other side, mp-units 2.2.1 needs this backport https://github.com/mpusz/mp-units/commit/0ac6a1701d2eb64c97c5f3adaa9ea2a118488c68

Next releases of fmt and mp-units should be compatible hopefully :)