fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
19.9k stars 2.43k forks source link

FMT_USE_NONTYPE_TEMPLATE_ARGS detection is wrong on trunk #3935

Closed timsong-cpp closed 3 months ago

timsong-cpp commented 3 months ago

With trunk GCC and -std=c++2c:

#include <fmt/compile.h>
using namespace fmt::literals;

int main() {
    fmt::print(""_cf);
}

does not compile with trunk fmt but does with 10.2.1:

https://gcc.godbolt.org/z/4WsvGP6bs

https://github.com/fmtlib/fmt/blob/aa52eb765dec0eb67fab4b035a4a05b82346c8f5/include/fmt/base.h#L143-L144 looks suspicious.

vitaut commented 3 months ago

Good catch, thanks! Looks like I accidentally inverted this check when cleaning it up.

vitaut commented 3 months ago

Fixed in #3937 (thanks @Arghnews).