@@ -830,7 +830,7 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclBaseName N,
830
830
} else {
831
831
if (!getContext ().LangOpts .EnableDeserializationRecovery )
832
832
fatal (mem.takeError ());
833
- consumeError (mem.takeError ());
833
+ diagnoseAndConsumeError (mem.takeError ());
834
834
}
835
835
}
836
836
}
@@ -860,7 +860,7 @@ void ModuleFile::lookupClassMember(ImportPath::Access accessPath,
860
860
if (!declOrError) {
861
861
if (!getContext ().LangOpts .EnableDeserializationRecovery )
862
862
fatal (declOrError.takeError ());
863
- consumeError (declOrError.takeError ());
863
+ diagnoseAndConsumeError (declOrError.takeError ());
864
864
continue ;
865
865
}
866
866
@@ -878,7 +878,7 @@ void ModuleFile::lookupClassMember(ImportPath::Access accessPath,
878
878
if (!declOrError) {
879
879
if (!getContext ().LangOpts .EnableDeserializationRecovery )
880
880
fatal (declOrError.takeError ());
881
- consumeError (declOrError.takeError ());
881
+ diagnoseAndConsumeError (declOrError.takeError ());
882
882
continue ;
883
883
}
884
884
@@ -902,7 +902,7 @@ void ModuleFile::lookupClassMember(ImportPath::Access accessPath,
902
902
if (!declOrError) {
903
903
if (!getContext ().LangOpts .EnableDeserializationRecovery )
904
904
fatal (declOrError.takeError ());
905
- consumeError (declOrError.takeError ());
905
+ diagnoseAndConsumeError (declOrError.takeError ());
906
906
continue ;
907
907
}
908
908
@@ -975,7 +975,7 @@ void ModuleFile::lookupObjCMethods(
975
975
// Deserialize the method and add it to the list.
976
976
auto declOrError = getDeclChecked (std::get<2 >(result));
977
977
if (!declOrError) {
978
- consumeError (declOrError.takeError ());
978
+ diagnoseAndConsumeError (declOrError.takeError ());
979
979
continue ;
980
980
}
981
981
@@ -1002,13 +1002,16 @@ void ModuleFile::getTopLevelDecls(
1002
1002
if (declOrError.errorIsA <DeclAttributesDidNotMatch>()) {
1003
1003
// Decl rejected by matchAttributes, ignore it.
1004
1004
assert (matchAttributes);
1005
- consumeError (declOrError.takeError ());
1005
+
1006
+ // We don't diagnose DeclAttributesDidNotMatch at the moment but
1007
+ // let's use the diagnose consume variant for consistency.
1008
+ diagnoseAndConsumeError (declOrError.takeError ());
1006
1009
continue ;
1007
1010
}
1008
1011
1009
1012
if (!getContext ().LangOpts .EnableDeserializationRecovery )
1010
1013
fatal (declOrError.takeError ());
1011
- consumeError (declOrError.takeError ());
1014
+ diagnoseAndConsumeError (declOrError.takeError ());
1012
1015
continue ;
1013
1016
}
1014
1017
if (!ABIRoleInfo (declOrError.get ()).providesAPI ()) // FIXME: flags
@@ -1024,7 +1027,7 @@ void ModuleFile::getExportedPrespecializations(
1024
1027
if (!declOrError) {
1025
1028
if (!getContext ().LangOpts .EnableDeserializationRecovery )
1026
1029
fatal (declOrError.takeError ());
1027
- consumeError (declOrError.takeError ());
1030
+ diagnoseAndConsumeError (declOrError.takeError ());
1028
1031
continue ;
1029
1032
}
1030
1033
results.push_back (declOrError.get ());
0 commit comments