@@ -830,7 +830,7 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclBaseName N,
830830 } else {
831831 if (!getContext ().LangOpts .EnableDeserializationRecovery )
832832 fatal (mem.takeError ());
833- consumeError (mem.takeError ());
833+ diagnoseAndConsumeError (mem.takeError ());
834834 }
835835 }
836836 }
@@ -860,7 +860,7 @@ void ModuleFile::lookupClassMember(ImportPath::Access accessPath,
860860 if (!declOrError) {
861861 if (!getContext ().LangOpts .EnableDeserializationRecovery )
862862 fatal (declOrError.takeError ());
863- consumeError (declOrError.takeError ());
863+ diagnoseAndConsumeError (declOrError.takeError ());
864864 continue ;
865865 }
866866
@@ -878,7 +878,7 @@ void ModuleFile::lookupClassMember(ImportPath::Access accessPath,
878878 if (!declOrError) {
879879 if (!getContext ().LangOpts .EnableDeserializationRecovery )
880880 fatal (declOrError.takeError ());
881- consumeError (declOrError.takeError ());
881+ diagnoseAndConsumeError (declOrError.takeError ());
882882 continue ;
883883 }
884884
@@ -902,7 +902,7 @@ void ModuleFile::lookupClassMember(ImportPath::Access accessPath,
902902 if (!declOrError) {
903903 if (!getContext ().LangOpts .EnableDeserializationRecovery )
904904 fatal (declOrError.takeError ());
905- consumeError (declOrError.takeError ());
905+ diagnoseAndConsumeError (declOrError.takeError ());
906906 continue ;
907907 }
908908
@@ -975,7 +975,7 @@ void ModuleFile::lookupObjCMethods(
975975 // Deserialize the method and add it to the list.
976976 auto declOrError = getDeclChecked (std::get<2 >(result));
977977 if (!declOrError) {
978- consumeError (declOrError.takeError ());
978+ diagnoseAndConsumeError (declOrError.takeError ());
979979 continue ;
980980 }
981981
@@ -1002,13 +1002,16 @@ void ModuleFile::getTopLevelDecls(
10021002 if (declOrError.errorIsA <DeclAttributesDidNotMatch>()) {
10031003 // Decl rejected by matchAttributes, ignore it.
10041004 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 ());
10061009 continue ;
10071010 }
10081011
10091012 if (!getContext ().LangOpts .EnableDeserializationRecovery )
10101013 fatal (declOrError.takeError ());
1011- consumeError (declOrError.takeError ());
1014+ diagnoseAndConsumeError (declOrError.takeError ());
10121015 continue ;
10131016 }
10141017 if (!ABIRoleInfo (declOrError.get ()).providesAPI ()) // FIXME: flags
@@ -1024,7 +1027,7 @@ void ModuleFile::getExportedPrespecializations(
10241027 if (!declOrError) {
10251028 if (!getContext ().LangOpts .EnableDeserializationRecovery )
10261029 fatal (declOrError.takeError ());
1027- consumeError (declOrError.takeError ());
1030+ diagnoseAndConsumeError (declOrError.takeError ());
10281031 continue ;
10291032 }
10301033 results.push_back (declOrError.get ());
0 commit comments