1 From 878c5c3cdc7513418662d6ff77c61b63a1b2538a Mon Sep 17 00:00:00 2001
2 From: Isuru Fernando <isuruf@gmail.com>
3 Date: Mon, 13 Oct 2025 16:10:25 -0500
4 Subject: [PATCH 09/10] Workaround nvcc bug in message_lite.h
6 See https://github.com/protocolbuffers/protobuf/issues/21542
8 Patch by Samuel Benzaquen (sbenzaquen)
10 src/google/protobuf/message_lite.h | 7 +++++++
11 1 file changed, 7 insertions(+)
13 diff --git a/src/google/protobuf/message_lite.h b/src/google/protobuf/message_lite.h
14 index c416114aa9..3994762f06 100644
15 --- a/src/google/protobuf/message_lite.h
16 +++ b/src/google/protobuf/message_lite.h
17 @@ -273,6 +273,12 @@ struct MessageTraitsImpl {
19 using MessageTraits = decltype(MessageTraitsImpl::value<T>);
22 +struct EnumTraitsImpl {
23 + template <typename T>
24 + static std::enable_if_t<sizeof(T) != 0> value;
27 struct EnumTraitsImpl {
29 // We use an incomplete type to cause a compiler error if something tries to
30 @@ -282,6 +288,7 @@ struct EnumTraitsImpl {
32 static std::enable_if_t<sizeof(T) != 0, Undefined> value;
36 using EnumTraits = decltype(EnumTraitsImpl::value<T>);