diff --git a/include/fmt/core.h b/include/fmt/core.h index 08312f7c..d201a372 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1256,7 +1256,13 @@ template struct named_arg : named_arg_base { }; template ::value)> -inline void check_format_string(const S&) {} +inline void check_format_string(const S&) { +#if defined(FMT_ENFORCE_COMPILE_STRING) + static_assert(is_compile_string::value, + "FMT_ENFORCE_COMPILE_STRING requires all format strings to " + "utilize FMT_STRING() or fmt()."); +#endif +} template ::value)> void check_format_string(S);