Skip to content

Commit

Permalink
constinit not working as expected in Visual Studio 2019 Update 16.10
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgolov committed Jun 2, 2021
1 parent b650ea4 commit bc46fce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/google/protobuf/port_def.inc
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,10 @@
#ifdef PROTOBUF_CONSTINIT
#error PROTOBUF_CONSTINIT was previously defined
#endif
#if defined(__cpp_constinit) && !PROTOBUF_GNUC_MIN(3, 0)
#if defined(__cpp_constinit) && !PROTOBUF_GNUC_MIN(3, 0) && !defined(_MSC_VER)
// Our use of constinit does not yet work with GCC:
// https://github.com/protocolbuffers/protobuf/issues/8310
// Does not work yet with Visual Studio 2019 Update 16.10
#define PROTOBUF_CONSTINIT constinit
#elif __has_cpp_attribute(clang::require_constant_initialization)
#define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]]
Expand Down

0 comments on commit bc46fce

Please sign in to comment.