Use __constinit only in GCC 12.2 and up (#9936)

Fixes #9916. GCC appears to have a bug preventing our use of __constinit
from working correctly, but this bug will be fixed in GCC 12.2.
pull/9938/head
Adam Cozzette 3 years ago committed by GitHub
parent 32d99bb00a
commit b180b2809f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/google/protobuf/port_def.inc

@ -650,7 +650,7 @@
(!defined(__APPLE__) && __clang_major__ >= 12)) (!defined(__APPLE__) && __clang_major__ >= 12))
#define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]] #define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]]
#define PROTOBUF_CONSTEXPR constexpr #define PROTOBUF_CONSTEXPR constexpr
#elif PROTOBUF_GNUC_MIN(12, 0) #elif PROTOBUF_GNUC_MIN(12, 2)
#define PROTOBUF_CONSTINIT __constinit #define PROTOBUF_CONSTINIT __constinit
#define PROTOBUF_CONSTEXPR constexpr #define PROTOBUF_CONSTEXPR constexpr
#else #else

Loading…
Cancel
Save