constinit not working as expected in Visual Studio 2019 Update 16.10

pull/8690/head
Max Golovanov 4 years ago
parent b650ea44b1
commit bc46fce1bd
  1. 3
      src/google/protobuf/port_def.inc

@ -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]]

Loading…
Cancel
Save