diff --git a/include/stdx/static_assert.hpp b/include/stdx/static_assert.hpp index 958498b..71d90e7 100644 --- a/include/stdx/static_assert.hpp +++ b/include/stdx/static_assert.hpp @@ -29,7 +29,7 @@ template constexpr auto ct_check = ct_check_t{}; // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define STATIC_ASSERT(cond, ...) \ - []() -> bool { \ + [&]() -> bool { \ STDX_PRAGMA(diagnostic push) \ STDX_PRAGMA(diagnostic ignored "-Wunknown-warning-option") \ STDX_PRAGMA(diagnostic ignored "-Wc++26-extensions") \ @@ -43,7 +43,7 @@ template constexpr auto ct_check = ct_check_t{}; // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define STATIC_ASSERT(cond, ...) \ - []() -> bool { \ + [&]() -> bool { \ constexpr auto S = STDX_CT_FORMAT(__VA_ARGS__); \ stdx::ct_check.template emit(); \ return B; \