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

FileChannel.cpp:323:35: error: direction: Cannot format an argument #180

Open
milahu opened this issue Jan 28, 2024 · 1 comment
Open

FileChannel.cpp:323:35: error: direction: Cannot format an argument #180

milahu opened this issue Jan 28, 2024 · 1 comment

Comments

@milahu
Copy link

milahu commented Jan 28, 2024

ricochet version cfa98b8 build fails with fmt versions

  • 10.1.0
  • 10.1.1
  • 10.2.1

FileChannel.cpp:323:35

emitFatalError(fmt::format("Unknown FileChannel::direction()", direction), tego_file_transfer_result_failure, true);

fmt::format("Unknown FileChannel::direction()", direction)

direction is not formattable

quickfix

-  fmt::format("Unknown FileChannel::direction()", direction)
+  "Unknown FileChannel::direction()"

fmt-10.1.1-dev/include/fmt/core.h:1576:63: error: 'fmt::v10::detail::type_is_unformattable_for<const Protocol::Channel::Direction, char> _' has incomplete type
fmt-10.1.1-dev/include/fmt/core.h:1580:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt

fmt docs: https://fmt.dev/latest/api.html#udt

[ 27%] Building CXX object libtego/CMakeFiles/tego.dir/source/protocol/FileChannel.cpp.o
In file included from /nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/format.h:49,
                 from /build/source/src/libtego/source/precomp.h:66,
                 from /build/source/src/build/libtego/CMakeFiles/tego.dir/cmake_pch.hxx:5,
                 from <command-line>:
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h: In instantiation of 'constexpr decltype (ctx.begin()) fmt::v10::detail::parse_format_specs(ParseContext&) [with T = Protocol::Channel::Direction; ParseContext = compile_parse_context<char>; decltype (ctx.begin()) = const char*]':
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h:2611:22:   required from 'constexpr fmt::v10::detail::format_string_checker<Char, Args>::format_string_checker(fmt::v10::basic_string_view<Char>) [with Char = char; Args = {Protocol::Channel::Direction}]'
/build/source/src/libtego/source/protocol/FileChannel.cpp:323:35:   required from here
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h:2548:45: error: 'fmt::v10::detail::type_is_unformattable_for<Protocol::Channel::Direction, char> _' has incomplete type
 2548 |     type_is_unformattable_for<T, char_type> _;
      |                                             ^
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h: In instantiation of 'constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_arg(T&) [with bool PACKED = true; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; T = const Protocol::Channel::Direction; typename std::enable_if<PACKED, int>::type <anonymous> = 0]':
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h:1808:51:   required from 'constexpr fmt::v10::format_arg_store<Context, Args>::format_arg_store(T& ...) [with T = {const Protocol::Channel::Direction}; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; Args = {Protocol::Channel::Direction}]'
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h:1826:18:   required from 'constexpr fmt::v10::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference<_Args>::type>::type ...> fmt::v10::make_format_args(T& ...) [with Context = basic_format_context<appender, char>; T = {const Protocol::Channel::Direction}]'
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h:2788:44:   required from 'std::string fmt::v10::format(format_string<T ...>, T&& ...) [with T = {const Protocol::Channel::Direction&}; std::string = std::__cxx11::basic_string<char>; format_string<T ...> = basic_format_string<char, const Protocol::Channel::Direction&>]'
/build/source/src/libtego/source/protocol/FileChannel.cpp:323:35:   required from here
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h:1576:63: error: 'fmt::v10::detail::type_is_unformattable_for<const Protocol::Channel::Direction, char> _' has incomplete type
 1576 |     type_is_unformattable_for<T, typename Context::char_type> _;
      |                                                               ^
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h:1580:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
 1580 |       formattable,
      |       ^~~~~~~~~~~
/nix/store/sgslg7d6dyr7962pc5dq6wl5g9p48bv2-fmt-10.1.1-dev/include/fmt/core.h:1580:7: note: 'formattable' evaluates to false
@milahu milahu changed the title build error with external fmt-10.1.1: FileChannel.cpp: direction: Cannot format an argument build error with fmt-10.1.1: FileChannel.cpp: direction: Cannot format an argument Jan 28, 2024
@milahu milahu changed the title build error with fmt-10.1.1: FileChannel.cpp: direction: Cannot format an argument FileChannel.cpp:323:35: error: direction: Cannot format an argument Jan 28, 2024
@morganava
Copy link
Collaborator

Yes I think I ran into this problem in another project as well, it seems it's no longer sufficient to implement an ostream operator<<(ostream&, T) function with newer fmt versions >:[

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

2 participants