Merge pull request #420 from TeBoring/3.0.0-alpha-3-fix

Fix C2385: ambiguous access to parent classes' member without specifying
This commit is contained in:
Paul Yang 2015-05-24 00:35:56 -07:00
commit 8ee267dda7
2 changed files with 14 additions and 4 deletions

9
.gitignore vendored
View File

@ -90,3 +90,12 @@ objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcuserdata/
objectivec/ProtocolBuffers_OSX.xcodeproj/xcuserdata/
objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcuserdata/
objectivec/ProtocolBuffers_iOS.xcodeproj/xcuserdata/
# Comformance test output
conformance/.libs/
conformance/com/
conformance/conformance-cpp
conformance/conformance-test-runner
conformance/conformance.pb.cc
conformance/conformance.pb.h
conformance/protoc_middleman

View File

@ -212,11 +212,11 @@ void
MapField<Key, T, kKeyFieldType, kValueFieldType,
default_enum_value>::SyncRepeatedFieldWithMapNoLock() const {
if (repeated_field_ == NULL) {
if (arena_ == NULL) {
if (MapFieldBase::arena_ == NULL) {
repeated_field_ = new RepeatedPtrField<Message>();
} else {
repeated_field_ =
Arena::CreateMessage<RepeatedPtrField<Message> >(arena_);
repeated_field_ = Arena::CreateMessage<RepeatedPtrField<Message> >(
MapFieldBase::arena_);
}
}
const Map<Key, T>& map = GetInternalMap();
@ -229,7 +229,8 @@ MapField<Key, T, kKeyFieldType, kValueFieldType,
it != map.end(); ++it) {
InitDefaultEntryOnce();
GOOGLE_CHECK(default_entry_ != NULL);
EntryType* new_entry = down_cast<EntryType*>(default_entry_->New(arena_));
EntryType* new_entry =
down_cast<EntryType*>(default_entry_->New(MapFieldBase::arena_));
repeated_field->AddAllocated(new_entry);
(*new_entry->mutable_key()) = it->first;
(*new_entry->mutable_value()) = it->second;