-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add consteval format string checks for wide strings #2390
Copy link
Copy link
Closed
Labels
Description
char-strings are properly rejected, but the same wchar_t-strings are happily compiled.
Example:
#include <string>
#include <string_view>
#include <fmt/core.h>
#include <fmt/xchar.h>
using namespace std::literals;
int main()
{
fmt::format(L"{:d}", L"I am not a number");
fmt::format(L"{:d}"s, L"I am not a number");
fmt::format(L"{:d}"sv, L"I am not a number");
fmt::format("{:d}", "I am not a number");
fmt::format("{:d}"s, "I am not a number");
fmt::format("{:d}"sv, "I am not a number");
}
Godbolt:
https://godbolt.org/z/jKr43Tqfs
Reactions are currently unavailable