From 9dc10fac843945a6f25b3221150a7917af19e509 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Wed, 5 Mar 2025 20:54:38 -0700 Subject: [PATCH] :bug: Fix warning arising from use of C++26 `static_assert` --- include/stdx/static_assert.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/stdx/static_assert.hpp b/include/stdx/static_assert.hpp index f7d80a2..7a67eb8 100644 --- a/include/stdx/static_assert.hpp +++ b/include/stdx/static_assert.hpp @@ -2,6 +2,7 @@ #if __cplusplus >= 202002L +#include #include #include @@ -38,6 +39,11 @@ 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 #define STATIC_ASSERT(cond, ...) \ []() -> bool { \ @@ -54,4 +60,6 @@ template constexpr auto static_format() { }.template operator()() #endif +STDX_PRAGMA(diagnostic pop) + #endif