-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
E2500 error in C++20 build (MSVC) format.h line 2748 (fmt v8.0.1) #2552
Comments
It's actually string literal operator template and it works thanks to C++20 non-type template parameter, without any GCC or Clang extensions. Looks like there is the same issue - #2536. |
I've reported this to the VS developers. |
This bug still happen after a year. It seem like Microsoft still didn't fix it. I cannot find any other solution other than changing to C++17 Hope this issue could be solved. |
Still no change with Visual Studio 17.5.0, but this can be worked around by defining |
This could be minor but the more I read up about it, the more it's looking like there's an issue here. Maybe you can code around it.
I'm getting an Intellisense-only error in format.h at line 2748 when building with VS2022. It seems to relate to the use of fixed_string in the template parameters.
The full error is:
E2500 a literal operator template must have a template parameter list equivalent to '<char ...>'
I'm using fmt V8.0.1 with headers only (FMT_HEADER_ONLY), with my language standard option set to /std:c++20. I've also tried /std:c++latest but the problem persists. It disappears when switching to /std:c++17.
I found this article (https://stackoverflow.com/questions/53789050/template-parameter-list-for-literal-operator) which seems to relate to the issue but may be out-of-date as it's a couple of years old. It seems to be saying that gcc is wrong in allowing non-char parameters, and quotes the following in the C++ standard (though it doesn't say which version of the standard):
"The declaration of a literal operator template shall have an empty parameter-declaration-clause and its template-parameter-list shall have a single template-parameter that is a non-type template parameter pack with element type char."
Please advise if this is something that should be changed to be more compliant.
Regards
Cliff
The text was updated successfully, but these errors were encountered: