diff --git a/llvm/include/llvm/Support/Format.h b/llvm/include/llvm/Support/Format.h index 2553002b37899..34b224dba5407 100644 --- a/llvm/include/llvm/Support/Format.h +++ b/llvm/include/llvm/Support/Format.h @@ -78,16 +78,6 @@ class LLVM_ABI format_object_base { /// printed, this synthesizes the string into a temporary buffer provided and /// returns whether or not it is big enough. -// Helper to validate that format() parameters are scalars or pointers. -template struct validate_format_parameters; -template -struct validate_format_parameters { - static_assert(std::is_scalar_v, - "format can't be used with non fundamental / non pointer type"); - validate_format_parameters() { validate_format_parameters(); } -}; -template <> struct validate_format_parameters<> {}; - template class format_object final : public format_object_base { std::tuple Vals; @@ -105,7 +95,9 @@ class format_object final : public format_object_base { public: format_object(const char *fmt, const Ts &... vals) : format_object_base(fmt), Vals(vals...) { - validate_format_parameters(); + static_assert( + (std::is_scalar_v && ...), + "format can't be used with non fundamental / non pointer type"); } int snprint(char *Buffer, unsigned BufferSize) const override {