From 109d80e2ba8a4bdb57dfe7bedab548b66bb6d15b Mon Sep 17 00:00:00 2001 From: swarmer Date: Tue, 27 Jan 2026 00:11:08 +0300 Subject: Forbid use of array types in UNIT_ASSERT conditions #30109 commit_hash:bfc1eb4f21ecb804205db2c38e09cda4b5b9cea4 --- library/cpp/testing/unittest/registar.h | 1 + 1 file changed, 1 insertion(+) (limited to 'library/cpp/testing') diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index b3b206ec5c1..16688659b8d 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -482,6 +482,7 @@ public: \ //bool #define UNIT_ASSERT_C(A, C) \ do { \ + static_assert(!std::is_array_v>, "An array type always evaluates to true in a condition; this is likely an error in the condition expression."); \ if (!(A)) { \ UNIT_FAIL_IMPL("assertion failed", Sprintf("(%s) %s", #A, (::TStringBuilder() << C).data())); \ } \ -- cgit v1.3