Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make_value is ambiguous on macOS Mojave 10.14.4 #1115

Closed
kgbook opened this issue Apr 14, 2019 · 4 comments
Closed

make_value is ambiguous on macOS Mojave 10.14.4 #1115

kgbook opened this issue Apr 14, 2019 · 4 comments

Comments

@kgbook
Copy link

kgbook commented Apr 14, 2019

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.
@kgbook kgbook changed the title make_value is ambiguous make_value is ambiguous on macOS Mojave 10.14.4 Apr 14, 2019
vitaut added a commit that referenced this issue Apr 14, 2019
@vitaut
Copy link
Contributor

vitaut commented Apr 14, 2019

Fixed in 5d755d0. Thanks for reporting!

@vedranmiletic
Copy link

vedranmiletic commented May 24, 2019

@vitaut any plans for 5.3.1 with this fix included? This affects Clang on Linux and FreeBSD too, and I also see it on g++-7 (Debian 7.4.0-9) 7.4.0 and g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516.

@vitaut
Copy link
Contributor

vitaut commented May 26, 2019

The fix will be included in the next release some time after 17 June.

@vedranmiletic
Copy link

@vitaut Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants