mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-04 19:25:51 +00:00
Only needed until this PR is merged https://github.com/conan-io/conan-center-index/pull/27982
22 lines
838 B
Diff
22 lines
838 B
Diff
diff --git a/src/google/protobuf/port.h b/src/google/protobuf/port.h
|
|
index 386ecc02a..32d260c42 100644
|
|
--- a/src/google/protobuf/port.h
|
|
+++ b/src/google/protobuf/port.h
|
|
@@ -502,10 +502,16 @@ class alignas(8) GlobalEmptyStringConstexpr {
|
|
// Nothing to init, or destroy.
|
|
std::string* Init() const { return nullptr; }
|
|
|
|
+ // Disable the optimization for MSVC.
|
|
+ // There are some builds where the default constructed string can't be used as
|
|
+ // `constinit` even though the constructor is `constexpr` and can be used
|
|
+ // during constant evaluation.
|
|
+#if !defined(_MSC_VER)
|
|
template <typename T = std::string, bool = (T(), true)>
|
|
static constexpr std::true_type HasConstexprDefaultConstructor(int) {
|
|
return {};
|
|
}
|
|
+#endif
|
|
static constexpr std::false_type HasConstexprDefaultConstructor(char) {
|
|
return {};
|
|
}
|