@@ -607,7 +607,7 @@ class TypeDefinedMapFieldBase : public MapFieldBase {
607607// This class provides access to map field using generated api. It is used for
608608// internal generated message implementation only. Users should never use this
609609// directly.
610- template <typename Derived , typename Key, typename T>
610+ template <const void * kGlobals , typename Key, typename T>
611611class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED MapField final
612612 : public TypeDefinedMapFieldBase<Key, T> {
613613 public:
@@ -625,14 +625,12 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED MapField final
625625 MapField (InternalVisibility, InternalMetadataOffset offset, Arena* arena,
626626 const MapField& from)
627627 : TypeDefinedMapFieldBase<Key, T>(
628- MessageGlobalsBase::ToDefaultInstance<Message>(
629- Derived::internal_message_globals ()),
630- offset, arena, from) {}
628+ MessageGlobalsBase::ToDefaultInstance<Message>(kGlobals ), offset,
629+ arena, from) {}
631630
632631 private:
633632 explicit constexpr MapField (InternalMetadataOffset offset)
634- : MapField::TypeDefinedMapFieldBase(Derived::internal_message_globals(),
635- offset) {}
633+ : MapField::TypeDefinedMapFieldBase(kGlobals , offset) {}
636634
637635 typedef void InternalArenaConstructable_;
638636 typedef void DestructorSkippable_;
@@ -651,23 +649,23 @@ bool AllAreInitialized(const TypeDefinedMapFieldBase<Key, T>& field) {
651649 return true ;
652650}
653651
654- template <typename Derived , typename Key, typename T>
655- using MapFieldWithArena = FieldWithArena<MapField<Derived , Key, T>>;
652+ template <const void * kGlobals , typename Key, typename T>
653+ using MapFieldWithArena = FieldWithArena<MapField<kGlobals , Key, T>>;
656654
657- template <typename Derived , typename Key, typename T>
658- struct FieldArenaRep <MapField<Derived , Key, T>> {
659- using Type = MapFieldWithArena<Derived , Key, T>;
655+ template <const void * kGlobals , typename Key, typename T>
656+ struct FieldArenaRep <MapField<kGlobals , Key, T>> {
657+ using Type = MapFieldWithArena<kGlobals , Key, T>;
660658
661- static MapField<Derived , Key, T>* Get (Type* arena_rep) {
659+ static MapField<kGlobals , Key, T>* Get (Type* arena_rep) {
662660 return &arena_rep->field ();
663661 }
664662};
665663
666- template <typename Derived , typename Key, typename T>
667- struct FieldArenaRep <const MapField<Derived , Key, T>> {
668- using Type = const MapFieldWithArena<Derived , Key, T>;
664+ template <const void * kGlobals , typename Key, typename T>
665+ struct FieldArenaRep <const MapField<kGlobals , Key, T>> {
666+ using Type = const MapFieldWithArena<kGlobals , Key, T>;
669667
670- static const MapField<Derived , Key, T>* Get (Type* arena_rep) {
668+ static const MapField<kGlobals , Key, T>* Get (Type* arena_rep) {
671669 return &arena_rep->field ();
672670 }
673671};
@@ -748,7 +746,7 @@ class PROTOBUF_EXPORT MapValueConstRef {
748746 FieldDescriptor::CppType type_;
749747
750748 private:
751- template <typename Derived , typename K, typename V>
749+ template <const void * kGlobals , typename K, typename V>
752750 friend class internal ::MapField;
753751 template <typename K, typename V>
754752 friend class internal ::TypeDefinedMapFieldBase;
@@ -852,7 +850,7 @@ class PROTOBUF_EXPORT MapIteratorBase {
852850 protected:
853851 template <typename Key, typename T>
854852 friend class internal ::TypeDefinedMapFieldBase;
855- template <typename Derived , typename Key, typename T>
853+ template <const void * kGlobals , typename Key, typename T>
856854 friend class internal ::MapField;
857855 friend class internal ::MapFieldBase;
858856
0 commit comments