diff --git a/include/fmt/core.h b/include/fmt/core.h index 632b7dfe..de398d29 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1258,7 +1258,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);