Skip to content

make_value is ambiguous on macOS Mojave 10.14.4 #1115

@kgbook

Description

@kgbook

fmt 5.3.0 version on macOS Mojave 10.14.4 (18E226).

#include <fmt/printf.h>
...

class Log {
public:
template<typename... Args>
    void infof(const char *arg, const Args &... args) {
        log_handle->info(fmt::sprintf(arg, args ...));
    }
    ...

private:
    std::shared_ptr<spdlog::logger> log_handle;
}

log:

In file included from /usr/local/include/fmt/printf.h:14:
In file included from /usr/local/include/fmt/ostream.h:11:
In file included from /usr/local/include/fmt/format.h:60:
/usr/local/include/fmt/core.h:1069:10: error: call to 'make_value' is ambiguous
  return make_value<Context>(value);

detailed log:

In file included from /Users/kang/project/sample/RTSPServer/utils/log.h:6:
In file included from /usr/local/include/fmt/printf.h:14:
In file included from /usr/local/include/fmt/ostream.h:11:
In file included from /usr/local/include/fmt/format.h:60:
/usr/local/include/fmt/core.h:1069:10: error: call to 'make_value' is ambiguous
  return make_value<Context>(value);
         ^~~~~~~~~~~~~~~~~~~
/usr/local/include/fmt/core.h:1180:23: note: in instantiation of function
      template specialization 'fmt::v5::internal::make_arg<true,
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >, volatile char>' requested here
    : data_{internal::make_arg<IS_PACKED, Context>(args)...} {}
                      ^
/usr/local/include/fmt/printf.h:759:38: note: in instantiation of member
      function
      'fmt::v5::format_arg_store<fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >, const char *, volatile char>::format_arg_store' requested here
  format_arg_store<context, Args...> as{ args... };
                                     ^
/Users/kang/project/sample/RTSPServer/utils/log.h:47:31: note: in instantiation
      of function template specialization 'fmt::v5::sprintf<const char *, const
      char *, volatile char>' requested here
        log_handle->info(fmt::sprintf(arg, args ...));
                              ^
/Users/kang/project/sample/RTSPServer/server/rtsp_service.cpp:98:10: note: in
      instantiation of function template specialization 'Log::infof<const char
      *, volatile char>' requested here
    log->infof("%s:terminate_event_loop:%d", service_name.c_str(), termi...
         ^
/usr/local/include/fmt/core.h:679:34: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >, Char = char]
  init<C, int, char_type>>::type make_value(Char val) { return val; }
                                 ^
/usr/local/include/fmt/core.h:746:3: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >, T = volatile char, Char = char]
  make_value(const T &val) { return val; }
  ^
/usr/local/include/fmt/core.h:655:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE_SAME(int_type, int)
^
/usr/local/include/fmt/core.h:650:36: note: expanded from macro
      'FMT_MAKE_VALUE_SAME'
  FMT_CONSTEXPR init<C, Type, TAG> make_value(Type val) { return val; }
                                   ^
/usr/local/include/fmt/core.h:652:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE(bool_type, bool, int)
^
/usr/local/include/fmt/core.h:644:41: note: expanded from macro 'FMT_MAKE_VALUE'
  FMT_CONSTEXPR init<C, ValueType, TAG> make_value(ArgType val) { \
                                        ^
/usr/local/include/fmt/core.h:653:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE(int_type, short, int)
^
/usr/local/include/fmt/core.h:644:41: note: expanded from macro 'FMT_MAKE_VALUE'
  FMT_CONSTEXPR init<C, ValueType, TAG> make_value(ArgType val) { \
                                        ^
/usr/local/include/fmt/core.h:654:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE(uint_type, unsigned short, unsigned)
^
/usr/local/include/fmt/core.h:644:41: note: expanded from macro 'FMT_MAKE_VALUE'
  FMT_CONSTEXPR init<C, ValueType, TAG> make_value(ArgType val) { \
                                        ^
/usr/local/include/fmt/core.h:656:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE_SAME(uint_type, unsigned)
^
/usr/local/include/fmt/core.h:650:36: note: expanded from macro
      'FMT_MAKE_VALUE_SAME'
  FMT_CONSTEXPR init<C, Type, TAG> make_value(Type val) { return val; }
                                   ^
/usr/local/include/fmt/core.h:662:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE(
^
/usr/local/include/fmt/core.h:644:41: note: expanded from macro 'FMT_MAKE_VALUE'
  FMT_CONSTEXPR init<C, ValueType, TAG> make_value(ArgType val) { \
                                        ^
/usr/local/include/fmt/core.h:666:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE(
^
/usr/local/include/fmt/core.h:644:41: note: expanded from macro 'FMT_MAKE_VALUE'
  FMT_CONSTEXPR init<C, ValueType, TAG> make_value(ArgType val) { \
                                        ^
/usr/local/include/fmt/core.h:670:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE_SAME(long_long_type, long long)
^
/usr/local/include/fmt/core.h:650:36: note: expanded from macro
      'FMT_MAKE_VALUE_SAME'
  FMT_CONSTEXPR init<C, Type, TAG> make_value(Type val) { return val; }
                                   ^
/usr/local/include/fmt/core.h:671:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE_SAME(ulong_long_type, unsigned long long)
^
/usr/local/include/fmt/core.h:650:36: note: expanded from macro
      'FMT_MAKE_VALUE_SAME'
  FMT_CONSTEXPR init<C, Type, TAG> make_value(Type val) { return val; }
                                   ^
/usr/local/include/fmt/core.h:672:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE(int_type, signed char, int)
^
/usr/local/include/fmt/core.h:644:41: note: expanded from macro 'FMT_MAKE_VALUE'
  FMT_CONSTEXPR init<C, ValueType, TAG> make_value(ArgType val) { \
                                        ^
/usr/local/include/fmt/core.h:673:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE(uint_type, unsigned char, unsigned)
^
/usr/local/include/fmt/core.h:644:41: note: expanded from macro 'FMT_MAKE_VALUE'
  FMT_CONSTEXPR init<C, ValueType, TAG> make_value(ArgType val) { \
                                        ^
/usr/local/include/fmt/core.h:686:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE(double_type, float, double)
^
/usr/local/include/fmt/core.h:644:41: note: expanded from macro 'FMT_MAKE_VALUE'
  FMT_CONSTEXPR init<C, ValueType, TAG> make_value(ArgType val) { \
                                        ^
/usr/local/include/fmt/core.h:687:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE_SAME(double_type, double)
^
/usr/local/include/fmt/core.h:650:36: note: expanded from macro
      'FMT_MAKE_VALUE_SAME'
  FMT_CONSTEXPR init<C, Type, TAG> make_value(Type val) { return val; }
                                   ^
/usr/local/include/fmt/core.h:688:1: note: candidate function [with C =
      fmt::v5::basic_printf_context<std::__1::back_insert_iterator<fmt::v5::internal::basic_buffer<char>
      >, char,
      fmt::v5::printf_arg_formatter<fmt::v5::back_insert_range<fmt::v5::internal::basic_buffer<char>
      > > >]
FMT_MAKE_VALUE_SAME(long_double_type, long double)
^
/usr/local/include/fmt/core.h:650:36: note: expanded from macro
      'FMT_MAKE_VALUE_SAME'
  FMT_CONSTEXPR init<C, Type, TAG> make_value(Type val) { return val; }
                                   ^
1 error generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions