Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMT_USE_NONTYPE_TEMPLATE_ARGS detection is wrong on trunk #3935

Closed
timsong-cpp opened this issue Apr 16, 2024 · 2 comments
Closed

FMT_USE_NONTYPE_TEMPLATE_ARGS detection is wrong on trunk #3935

timsong-cpp opened this issue Apr 16, 2024 · 2 comments

Comments

@timsong-cpp
Copy link
Contributor

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

fmt/include/fmt/base.h

Lines 143 to 144 in aa52eb7

#elif FMT_GCC_VERSION >= 903 && FMT_CPLUSPLUS >= 201709L
# define FMT_USE_NONTYPE_TEMPLATE_ARGS 0
looks suspicious.

@vitaut
Copy link
Contributor

vitaut commented Apr 16, 2024

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

@vitaut
Copy link
Contributor

vitaut commented Apr 16, 2024

Fixed in #3937 (thanks @Arghnews).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants