Enable the custom new implementation when using custom vtables, even without

the compiler intrinsic.
We don't need the intrinsic if we are not using virtual functions.

PiperOrigin-RevId: 676520163
pull/18393/head
Protobuf Team Bot 2 months ago committed by Copybara-Service
parent 1c35963010
commit 01c8cab1cd
  1. 8
      src/google/protobuf/port.h

@ -379,7 +379,13 @@ constexpr T* Launder(T* p) {
#endif
}
#if ABSL_HAVE_BUILTIN(__is_bitwise_cloneable)
#if defined(PROTOBUF_CUSTOM_VTABLE)
constexpr bool EnableCustomNew() { return true; }
template <typename T>
constexpr bool EnableCustomNewFor() {
return true;
}
#elif ABSL_HAVE_BUILTIN(__is_bitwise_cloneable)
constexpr bool EnableCustomNew() { return true; }
template <typename T>
constexpr bool EnableCustomNewFor() {

Loading…
Cancel
Save