Avoid dropping null byte in format string (#4732)

* Avoid dropping null byte in format string

* Add a test for null byte in format string
This commit is contained in:
user202729
2026-04-24 00:34:27 +08:00
committed by GitHub
parent 4b50ad7944
commit eeff8680ed
2 changed files with 13 additions and 3 deletions

View File

@@ -239,6 +239,16 @@ if (CMAKE_CXX_STANDARD GREATER_EQUAL 20)
#endif
"
ERROR)
expect_compile(
format-string-embedded-nul-error
"
#if FMT_USE_CONSTEVAL
fmt::format(\"a\\0{}\");
#else
#error
#endif
"
ERROR)
# Compile-time argument name check
expect_compile(