File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2690,16 +2690,16 @@ template <typename... T> struct fstring {
26902690 static_assert (count<(is_view<remove_cvref_t <T>>::value &&
26912691 std::is_reference<T>::value)...>() == 0 ,
26922692 " passing views as lvalues is disallowed" );
2693- if (FMT_USE_CONSTEVAL) parse_format_string<char >(s, checker (s, arg_pack ()));
2693+ if (FMT_USE_CONSTEVAL)
2694+ parse_format_string<char >(str, checker (str, arg_pack ()));
26942695 constexpr bool unused = detail::enforce_compile_checks<sizeof (s) != 0 >();
26952696 (void )unused;
26962697 }
26972698 template <typename S,
26982699 FMT_ENABLE_IF (std::is_convertible<const S&, string_view>::value)>
26992700 FMT_CONSTEVAL FMT_ALWAYS_INLINE fstring(const S& s) : str(s) {
2700- auto sv = string_view (str);
27012701 if (FMT_USE_CONSTEVAL)
2702- detail::parse_format_string<char >(sv , checker (sv , arg_pack ()));
2702+ detail::parse_format_string<char >(str , checker (str , arg_pack ()));
27032703 constexpr bool unused = detail::enforce_compile_checks<sizeof (s) != 0 >();
27042704 (void )unused;
27052705 }
Original file line number Diff line number Diff line change @@ -239,6 +239,16 @@ if (CMAKE_CXX_STANDARD GREATER_EQUAL 20)
239239 #endif
240240 "
241241 ERROR )
242+ expect_compile (
243+ format-string-embedded-nul-error
244+ "
245+ #if FMT_USE_CONSTEVAL
246+ fmt::format(\" a\\ 0{}\" );
247+ #else
248+ #error
249+ #endif
250+ "
251+ ERROR )
242252
243253 # Compile-time argument name check
244254 expect_compile (
You can’t perform that action at this time.
0 commit comments