-
Notifications
You must be signed in to change notification settings - Fork 260
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
[BUG] string interpolation of certain types warns about "non-portable usage of variadic functions" #1136
Comments
Addendum: Clang always fails to compile this even if you don't turn up all the warnings. If you instead use |
Thanks! Fixed... now the first case works as expected, and the second case gives the correct "not customized" message for That said, I could see adding support for "anything you can stream with |
Thanks. I think the crashes were related to the fact that For the |
…auto const&` This avoids errors about passing non-PODs to variadics (even though the parameter is never used), and ensures the catchall is used only for a single parameter (not inadvertently for a format string) Closes hsutter#1136
Catching up: Last week's commit cced142 also added the support you asked for above to allow interpolating |
Sweet. Thanks! |
Describe the bug
Title. This one has different effects on different compilers.
To Reproduce
Steps to reproduce the behavior:
Clang 17:
-std=c++20 -Wall -Wextra -pedantic -Werror
MSVC:
/std:c++latest /MD /EHsc /experimental:module /W4 /WX
I would expect these to compile on all compilers, they seem to work in GCC 14. But non-GCC compilers seem unhappy about it.
On clang I get the following:
On MSVC I get roughly:
So the
@enum
case seems to fail in clang (presumably because it defines ato_string
member function?) and thestd::filesystem::path
case seems to fail on MSVC. This latter one I have no idea whats wrong.Additional context
For the
@enum
case, callingto_string
directly seems to workaround the issue, although that mostly makes the string interpolation redundant.Initially I thought about opening an issue for each case, but they seem very related. Also I think these have to do with the definition at
cpp2util.h:1192
.The text was updated successfully, but these errors were encountered: