Compile failure on ubuntu 20.04 (gcc 9.4) · Issue #4313 · fmtlib/fmt · GitHub
Skip to content

Compile failure on ubuntu 20.04 (gcc 9.4) #4313

Description

@rossburton

When building fmt 11.1.1 and 11.1.2 on Ubuntu 20.04 (g++ 9.4.0), the tests fail:

FAILED: test/CMakeFiles/ostream-test.dir/ostream-test.cc.o
/BUILD/hosttools/g++ -DFMT_SHARED -DGTEST_HAS_STD_WSTRING=1 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1 -I/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include -isystem /BUILD/work/x86_64-linux/fmt-native/11.1.2/git/test/gtest/. -isystem/BUILD/work/x86_64-linux/fmt-native/11.1.2/recipe-sysroot-native/usr/include -O2 -pipe -fvisibility-inlines-hidden -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT test/CMakeFiles/ostream-test.dir/ostream-test.cc.o -MF test/CMakeFiles/ostream-test.dir/ostream-test.cc.o.d -o test/CMakeFiles/ostream-test.dir/ostream-test.cc.o -c /BUILD/work/x86_64-linux/fmt-native/11.1.2/git/test/ostream-test.cc
In file included from /BUILD/work/x86_64-linux/fmt-native/11.1.2/git/test/ostream-test.cc:10:
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/format.h: In instantiation of ‘constexpr decltype (ctx.out()) fmt::v11::formatter<fmt::v11::detail::std_string_view<Char>, Char>::format(fmt::v11::detail::std_string_view<Char>, FormatContext&) const [with FormatContext = fmt::v11::context; Char = char; decltype (ctx.out()) = fmt::v11::basic_appender<char>]’:
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/base.h:1126:54:   required by substitution of ‘template<class Char, class T, class U> decltype ((fmt::v11::formatter<U, Char>().format((* p), (* ctx)), std::true_type())) fmt::v11::detail::has_formatter_impl(T*, fmt::v11::buffered_context<Char>*) [with Char = char; T = fmt::v11::detail::std_string_view<char>; U = fmt::v11::detail::std_string_view<char>]’
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/base.h:1131:43:   required from ‘constexpr bool fmt::v11::detail::has_formatter() [with T = fmt::v11::detail::std_string_view<char>; Char = char]’
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/base.h:1187:62:   required by substitution of ‘template<bool B, class T, class F> using conditional_t = typename std::conditional::type [with bool B = fmt::v11::detail::has_formatter<fmt::v11::detail::std_string_view<char>, char>(); T = fmt::v11::detail::std_string_view<char>&; F = void]’
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/base.h:1187:15:   required by substitution of ‘template<class T, typename std::enable_if<fmt::v11::detail::use_formatter<T, typename std::remove_const<_Tp>::type>::value, int>::type <anonymous> > static fmt::v11::conditional_t<has_formatter<T, char>(), T&, void> fmt::v11::detail::type_mapper<char>::map<T, <enumerator> >(T&) [with T = fmt::v11::detail::std_string_view<char>; typename std::enable_if<fmt::v11::detail::use_formatter<T, typename std::remove_const<_Tp>::type>::value, int>::type <anonymous> = 0]’
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/base.h:1195:57:   required by substitution of ‘template<class T, class Char> using is_formattable = fmt::v11::bool_constant<(! std::is_same<decltype (fmt::v11::detail::type_mapper<Char>::map(declval<typename std::conditional<std::is_void<_Tp>::value, int*, T>::type&>())), void>::value)> [with T = fmt::v11::detail::std_string_view<char>; Char = char]’
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/test/ostream-test.cc:273:3:   required from here
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/format.h:3764:43: error: no matching function for call to ‘fmt::v11::formatter<fmt::v11::detail::std_string_view<char>, char, void>::format(fmt::v11::detail::std_string_view<char>&, fmt::v11::context&) const’
 3764 |       return formatter<Base, Char>::format(value, ctx);             \
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/format.h:3775:1: note: in expansion of macro ‘FMT_FORMAT_AS’
 3775 | FMT_FORMAT_AS(detail::std_string_view<Char>, basic_string_view<Char>);
      | ^~~~~~~~~~~~~
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/format.h:3632:20: note: candidate: ‘template<class FormatContext> constexpr decltype (ctx.out()) fmt::v11::detail::native_formatter<T, Char, TYPE>::format(const T&, FormatContext&) const [with FormatContext = FormatContext; T = fmt::v11::basic_string_view<char>; Char = char; fmt::v11::detail::type TYPE = fmt::v11::detail::type::string_type]’
 3632 | FMT_CONSTEXPR auto native_formatter<T, Char, TYPE>::format(
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/format.h:3632:20: note:   template argument deduction/substitution failed:
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/format.h:3764:44: note:   cannot convert ‘value’ (type ‘fmt::v11::detail::std_string_view<char>’) to type ‘const fmt::v11::basic_string_view<char>&’
 3764 |       return formatter<Base, Char>::format(value, ctx);             \
      |                                            ^~~~~
/BUILD/work/x86_64-linux/fmt-native/11.1.2/git/include/fmt/format.h:3775:1: note: in expansion of macro ‘FMT_FORMAT_AS’
 3775 | FMT_FORMAT_AS(detail::std_string_view<Char>, basic_string_view<Char>);
      | ^~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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