From 35b564845c60282e32fe0704115fa7f243b20a25 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Wed, 20 Dec 2023 09:00:04 -0800 Subject: [PATCH] Do not define a `const` static variable as `constexpr`. While this is legal it is not supported in all toolchains. Should fix https://github.com/protocolbuffers/protobuf/issues/15030 PiperOrigin-RevId: 592574780 --- src/google/protobuf/message.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index 26f6efc283..16f0862309 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -192,9 +192,10 @@ static std::string InitializationErrorStringImpl(const MessageLite& msg) { return DownCast(msg).InitializationErrorString(); } -constexpr MessageLite::DescriptorMethods Message::kDescriptorMethods = { - GetTypeNameImpl, - InitializationErrorStringImpl, +PROTOBUF_CONSTINIT const MessageLite::DescriptorMethods + Message::kDescriptorMethods = { + GetTypeNameImpl, + InitializationErrorStringImpl, }; namespace internal {