From ab0116e2f05c6156c4bc3d35986de1e98cc27016 Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Mon, 30 Jan 2023 15:05:29 -0500 Subject: [Clang] Improve error message for violations of -fmodules-decluse. Now it reports the name of the indirectly-used module which is missing. Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D142925 --- clang/lib/Lex/ModuleMap.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Lex/ModuleMap.cpp') diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index ee2cca4..15f4377 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -528,8 +528,9 @@ void ModuleMap::diagnoseHeaderInclusion(Module *RequestingModule, // We have found a module, but we don't use it. if (NotUsed) { - Diags.Report(FilenameLoc, diag::err_undeclared_use_of_module) - << RequestingModule->getTopLevelModule()->Name << Filename; + Diags.Report(FilenameLoc, diag::err_undeclared_use_of_module_indirect) + << RequestingModule->getTopLevelModule()->Name << Filename + << NotUsed->Name; return; } -- cgit v1.1