Skip to content

Commit 7070181

Browse files
committed
🐛 Don't capture in STATIC_ASSERT macro
Problem; - All the arguments to `STATIC_ASSERT` are `constexpr` and must not be captured in the `STATIC_ASSERT` lambda. Solution: - Remove capture clauses.
1 parent 0d77b76 commit 7070181

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/stdx/static_assert.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ template <bool B> constexpr auto ct_check = ct_check_t<B>{};
3131

3232
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
3333
#define STATIC_ASSERT(cond, ...) \
34-
[&]<bool B>() -> bool { \
34+
[]<bool B>() -> bool { \
3535
STDX_PRAGMA(diagnostic push) \
3636
STDX_PRAGMA(diagnostic ignored "-Wunknown-warning-option") \
3737
STDX_PRAGMA(diagnostic ignored "-Wc++26-extensions") \
@@ -45,7 +45,7 @@ template <bool B> constexpr auto ct_check = ct_check_t<B>{};
4545

4646
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
4747
#define STATIC_ASSERT(cond, ...) \
48-
[&]<bool B>() -> bool { \
48+
[]<bool B>() -> bool { \
4949
constexpr auto S = STDX_CT_FORMAT(__VA_ARGS__); \
5050
stdx::detail::ct_check<B>.template emit<S>(); \
5151
return B; \

0 commit comments

Comments
 (0)