From 6aa501d56d133fde03431350f6a99c1fb69e0080 Mon Sep 17 00:00:00 2001 From: user202729 <25191436+user202729@users.noreply.github.com> Date: Thu, 23 Apr 2026 09:04:15 +0700 Subject: [PATCH] Add a test for null byte in format string --- test/compile-error-test/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/compile-error-test/CMakeLists.txt b/test/compile-error-test/CMakeLists.txt index 4725d333..5b57a2cf 100644 --- a/test/compile-error-test/CMakeLists.txt +++ b/test/compile-error-test/CMakeLists.txt @@ -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(