diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 4f73ff99f4a5..ad1cec3304d2 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -568,7 +568,7 @@ // 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) +#elif !defined(_MSC_VER) && __has_cpp_attribute(clang::require_constant_initialization) #define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]] #else #define PROTOBUF_CONSTINIT