diff --git a/include/stdx/static_assert.hpp b/include/stdx/static_assert.hpp index 7a67eb8..53bb34e 100644 --- a/include/stdx/static_assert.hpp +++ b/include/stdx/static_assert.hpp @@ -39,16 +39,16 @@ template constexpr auto static_format() { } // namespace v1 } // namespace stdx -STDX_PRAGMA(diagnostic push) -#ifdef __clang__ -STDX_PRAGMA(diagnostic ignored "-Wunknown-warning-option") -STDX_PRAGMA(diagnostic ignored "-Wc++26-extensions") -#endif #if __cpp_static_assert >= 202306L +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define STATIC_ASSERT(cond, ...) \ []() -> bool { \ + STDX_PRAGMA(diagnostic push) \ + STDX_PRAGMA(diagnostic ignored "-Wunknown-warning-option") \ + STDX_PRAGMA(diagnostic ignored "-Wc++26-extensions") \ static_assert( \ B, std::string_view{stdx::detail::static_format<__VA_ARGS__>()}); \ + STDX_PRAGMA(diagnostic pop) \ return B; \ }.template operator()() #else @@ -58,8 +58,6 @@ STDX_PRAGMA(diagnostic ignored "-Wc++26-extensions") stdx::ct_check.template emit()>(); \ return B; \ }.template operator()() - #endif -STDX_PRAGMA(diagnostic pop) #endif