@@ -79,7 +79,10 @@ @interface GPBMessage () {
7979 // be protected with an @synchronized(self) block (that way the code also doesn't have to
8080 // worry about throws).
8181 NSMutableData *unknownFieldData_;
82+ #pragma clang diagnostic push
83+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
8284 GPBUnknownFieldSet *unknownFields_;
85+ #pragma clang diagnostic pop
8386
8487 NSMutableDictionary *extensionMap_;
8588 // Readonly access to autocreatedExtensionMap_ is protected via readOnlyLock_.
@@ -1106,6 +1109,8 @@ void GPBClearMessageAutocreator(GPBMessage *self) {
11061109 self->autocreatorExtension_ = nil ;
11071110}
11081111
1112+ #pragma clang diagnostic push
1113+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
11091114GPB_NOINLINE
11101115static void MergeUnknownFieldDataIntoFieldSet (GPBMessage *self, NSData *data,
11111116 GPBUnknownFieldSet *targetSet) {
@@ -1151,6 +1156,7 @@ static void MergeUnknownFieldDataIntoFieldSet(GPBMessage *self, NSData *data,
11511156 [decodeInto release ];
11521157 }
11531158}
1159+ #pragma clang diagnostic pop
11541160
11551161@implementation GPBMessage
11561162
@@ -1481,7 +1487,14 @@ - (void)internalClear:(BOOL)zeroStorage {
14811487}
14821488
14831489- (void )clearUnknownFields {
1484- self.unknownFields = nil ;
1490+ [unknownFieldData_ release ];
1491+ unknownFieldData_ = nil ;
1492+ #pragma clang diagnostic push
1493+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
1494+ [unknownFields_ release ];
1495+ unknownFields_ = nil ;
1496+ #pragma clang diagnostic pop
1497+ GPBBecomeVisibleToAutocreator (self);
14851498}
14861499
14871500- (BOOL )mergeUnknownFields:(GPBUnknownFields *)unknownFields
@@ -3149,6 +3162,8 @@ - (BOOL)isEqual:(id)other {
31493162 // need to guard against is concurrent r/o access, so we can grab the values (and retain them)
31503163 // so we have a version to compare against safely incase the second access causes the transform
31513164 // between internal states.
3165+ #pragma clang diagnostic push
3166+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
31523167 GPBUnknownFieldSet *selfUnknownFields;
31533168 NSData *selfUnknownFieldData;
31543169 @synchronized (self) {
@@ -3161,6 +3176,7 @@ - (BOOL)isEqual:(id)other {
31613176 otherUnknownFields = [otherMsg->unknownFields_ retain ];
31623177 otherUnknownFieldData = [otherMsg->unknownFieldData_ retain ];
31633178 }
3179+ #pragma clang diagnostic pop
31643180#if defined(DEBUG) && DEBUG && !defined(NS_BLOCK_ASSERTIONS)
31653181 if (selfUnknownFields) {
31663182 NSAssert (selfUnknownFieldData == nil , @" Internal error both unknown states were set" );
@@ -3189,6 +3205,8 @@ - (BOOL)isEqual:(id)other {
31893205 result = [selfUnknownFields isEqual: otherUnknownFields];
31903206 } else {
31913207 // At this point, we're done to one have a set/nothing, and the other having data/nothing.
3208+ #pragma clang diagnostic push
3209+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
31923210 GPBUnknownFieldSet *theSet = selfUnknownFields ? selfUnknownFields : otherUnknownFields;
31933211 NSData *theData = selfUnknownFieldData ? selfUnknownFieldData : otherUnknownFieldData;
31943212 if (theSet) {
@@ -3204,6 +3222,7 @@ - (BOOL)isEqual:(id)other {
32043222 // It was a data/nothing and nothing, so they equal if the other didn't have data.
32053223 result = theData == nil ;
32063224 }
3225+ #pragma clang diagnostic pop
32073226 }
32083227
32093228 [selfUnknownFields release ];
@@ -4015,7 +4034,10 @@ id GPBGetObjectIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) {
40154034NSData *GPBMessageUnknownFieldsData (GPBMessage *self) {
40164035 NSData *result = nil ;
40174036 @synchronized (self) {
4037+ #pragma clang diagnostic push
4038+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
40184039 GPBUnknownFieldSet *unknownFields = self->unknownFields_ ;
4040+ #pragma clang diagnostic pop
40194041 if (unknownFields) {
40204042#if defined(DEBUG) && DEBUG
40214043 NSCAssert (self->unknownFieldData_ == nil , @" Internal error both unknown states were set" );
0 commit comments