Skip to content

Compile error: partial specialization of struct fmt::v11::formatter #4303

@std-any-emplace

Description

@std-any-emplace

Printing a const std::filesystem::path with fileystem, fmt/ostream.h and fmt/std.h included and later including fmt/ranges.h in the same compilation unit causes a strange compile error.

Tested with fmt-11.0.0 and gcc-14.2.

#include <filesystem>
#include <fmt/ostream.h>
#include <fmt/std.h>

void f()
{
    const auto fn = std::filesystem::path{};
    fmt::print("{}", fn);
}

#include <fmt/ranges.h>

https://godbolt.org/z/G5TPbz7o9

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