diff --git a/src/google/protobuf/map_field.cc b/src/google/protobuf/map_field.cc index 7456593..18f25be 100644 --- a/src/google/protobuf/map_field.cc +++ b/src/google/protobuf/map_field.cc @@ -588,8 +588,8 @@ MapIteratorBase::MapIteratorBase(MapFieldBase* map, value_.SetType(descriptor->map_value()->cpp_type()); } -template class MapIteratorBase; -template class MapIteratorBase; +template class PROTOBUF_EXPORT_TEMPLATE_DEFINE MapIteratorBase; +template class PROTOBUF_EXPORT_TEMPLATE_DEFINE MapIteratorBase; } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h index a5d1d1d..7862c3e 100644 --- a/src/google/protobuf/map_field.h +++ b/src/google/protobuf/map_field.h @@ -822,7 +822,7 @@ class PROTOBUF_EXPORT MapValueRef final : public MapValueConstRef { #undef TYPE_CHECK template -class PROTOBUF_EXPORT MapIteratorBase { +class MapIteratorBase { using MessageT = std::conditional_t; using MapFieldBase = std::conditional_t; -extern template class MapIteratorBase; +extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE MapIteratorBase; +extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE MapIteratorBase; class PROTOBUF_EXPORT ConstMapIterator final : public MapIteratorBase {