Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Broken fmt::is_formattable<void> #4147

@phprus

Description

@phprus

Expect:

fmt::is_formattable<void>::value == false

Actual (build error):

In file included from /opt/compiler-explorer/libs/fmt/trunk/include/fmt/format.h:41,
                 from <source>:1:
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/base.h: In substitution of 'template<class T, class Char> using is_formattable = fmt::v11::bool_constant<(! std::is_base_of<fmt::v11::detail::unformattable, decltype (fmt::v11::detail::arg_mapper<Char>::map(declval<T&>()))>::value)> [with T = void; Char = char]':
<source>:6:44:   required from here
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/base.h:1269:73: error: forming reference to void
 1269 | using mapped_t = decltype(detail::arg_mapper<Char>::map(std::declval<T&>()));
      |                                                         ~~~~~~~~~~~~~~~~^~
Execution build compiler returned: 1

godbolt (new link):
https://godbolt.org/z/xro8619b4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions