Skip to content

Commit eae3e6d

Browse files
CEL Dev Teamcopybara-github
authored andcommitted
Only ignore warning in clang >= 20
`-Wnontrivial-memcall` was only introduced in clang v20. In earlier versions, the pragma raises an error because the warning does not exist. PiperOrigin-RevId: 789473674
1 parent 4875dab commit eae3e6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/values/value_variant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ class alignas(kValueVariantAlign) CEL_COMMON_INTERNAL_VALUE_VARIANT_TRIVIAL_ABI
737737
#if defined(__GNUC__) && !defined(__clang__)
738738
#pragma GCC diagnostic push
739739
#pragma GCC diagnostic ignored "-Wclass-memaccess"
740-
#elif defined(__clang__)
740+
#elif defined(__clang__) && __clang_major__ >= 20
741741
#pragma clang diagnostic push
742742
#pragma clang diagnostic ignored "-Wnontrivial-memcall"
743743
#endif
@@ -751,7 +751,7 @@ class alignas(kValueVariantAlign) CEL_COMMON_INTERNAL_VALUE_VARIANT_TRIVIAL_ABI
751751
std::memcpy(std::addressof(rhs), tmp, sizeof(ValueVariant));
752752
#if defined(__GNUC__) && !defined(__clang__)
753753
#pragma GCC diagnostic pop
754-
#elif defined(__clang__)
754+
#elif defined(__clang__) && __clang_major__ >= 20
755755
#pragma clang diagnostic pop
756756
#endif
757757
} else {

0 commit comments

Comments
 (0)