Skip to content

std::ostream support for fmt::printf is broken since f72a905 #1631

@375gnu

Description

@375gnu

Consider the following example:

#include <fmt/printf.h>
#include <filesystem>
int main()
{
        fmt::printf("%s\n", std::filesystem::path("/dev/null"));
}

Since f72a905 it's not possible to compile it:

include/fmt/format.h:2680:53: error: ‘class fmt::v6::basic_printf_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char>’ has no member named ‘error_handler’
                                                 ctx.error_handler());
                                                 ~~~~^~~~~~~~~~~~~
include/fmt/format.h:2683:48: error: no matching function for call to ‘fmt::v6::basic_printf_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char>::arg(fmt::v6::basic_string_view<char>&)’
     value = internal::get_dynamic_spec<Handler>(ctx.arg(ref.val.name),
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
                                                 ctx.error_handler());
                                                 ~~~~~~~~~~~~~~~~~~~~

Full g++ error.log

I tested with gcc 7 & 8 and clang 9 but with gcc 7 lib.

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