diff --git a/src/google/protobuf/message_lite.h b/src/google/protobuf/message_lite.h index 41a7789142..3d43397486 100644 --- a/src/google/protobuf/message_lite.h +++ b/src/google/protobuf/message_lite.h @@ -198,6 +198,10 @@ class PROTOBUF_EXPORT CachedSize { ABSL_DCHECK_NE(desired, 0); __atomic_store_n(&atom_, desired, __ATOMIC_RELAXED); } + + void SetNoDefaultInstance(Scalar desired) const noexcept { + __atomic_store_n(&atom_, desired, __ATOMIC_RELAXED); + } #else CachedSize(const CachedSize& other) noexcept : atom_(other.Get()) {} CachedSize& operator=(const CachedSize& other) noexcept { @@ -222,6 +226,10 @@ class PROTOBUF_EXPORT CachedSize { ABSL_DCHECK_NE(desired, 0); atom_.store(desired, std::memory_order_relaxed); } + + void SetNoDefaultInstance(Scalar desired) const noexcept { + atom_.store(desired, std::memory_order_relaxed); + } #endif private: