Skip to content

FMT_COMPILE(s) does not work with chrono example #2280

Closed
@toughengineer

Description

@toughengineer

chrono example from here
https://fmt.dev/latest/syntax.html
works on its own

(click to expand the initial example)
#include <fmt/chrono.h>

auto t = tm();
t.tm_year = 2010 - 1900;
t.tm_mon = 6;
t.tm_mday = 4;
t.tm_hour = 12;
t.tm_min = 15;
t.tm_sec = 58;
fmt::print("{:%Y-%m-%d %H:%M:%S}", t);

but fails to compile with latest master with all latest major compilers when used with FMT_COMPILE(s) as explained here
https://fmt.dev/latest/api.html#compile-api
like this:

fmt::print(FMT_COMPILE("{:%Y-%m-%dT%H:%M:%S}"), t);

E.g. see
https://godbolt.org/z/TzzG3cvGe

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