Skip to content

Commit

Permalink
Use __constinit only in GCC 12.2 and up (#9936)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
acozzette authored May 9, 2022
1 parent 32d99bb commit b180b28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/google/protobuf/port_def.inc
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@
(!defined(__APPLE__) && __clang_major__ >= 12))
#define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]]
#define PROTOBUF_CONSTEXPR constexpr
#elif PROTOBUF_GNUC_MIN(12, 0)
#elif PROTOBUF_GNUC_MIN(12, 2)
#define PROTOBUF_CONSTINIT __constinit
#define PROTOBUF_CONSTEXPR constexpr
#else
Expand Down

0 comments on commit b180b28

Please sign in to comment.