diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -516,14 +516,14 @@ // We have found a header, but it is private. if (Private) { Diags.Report(FilenameLoc, diag::warn_use_of_private_header_outside_module) - << Filename; + << File->getName(); return; } // 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; + << RequestingModule->getTopLevelModule()->Name << File->getName(); return; } @@ -534,7 +534,7 @@ if (RequestingModule && LangOpts.ModulesStrictDeclUse) { Diags.Report(FilenameLoc, diag::err_undeclared_use_of_module) - << RequestingModule->getTopLevelModule()->Name << Filename; + << RequestingModule->getTopLevelModule()->Name << File->getName(); } else if (RequestingModule && RequestingModuleIsModuleInterface && LangOpts.isCompilingModule()) { // Do not diagnose when we are not compiling a module. diff --git a/clang/test/Modules/declare-use1.cpp b/clang/test/Modules/declare-use1.cpp --- a/clang/test/Modules/declare-use1.cpp +++ b/clang/test/Modules/declare-use1.cpp @@ -3,7 +3,7 @@ #include "g.h" #include "e.h" -#include "f.h" // expected-error {{module XG does not depend on a module exporting 'f.h'}} +#include "f.h" // expected-error-re {{module XG does not depend on a module exporting '{{.*}}{{/|\\}}f.h'}} #include "i.h" #include "sub.h" const int g2 = g1 + e + f + aux_i + sub; diff --git a/clang/test/Modules/declare-use2.cpp b/clang/test/Modules/declare-use2.cpp --- a/clang/test/Modules/declare-use2.cpp +++ b/clang/test/Modules/declare-use2.cpp @@ -3,5 +3,5 @@ #include "h.h" #include "e.h" -#include "f.h" // expected-error {{module XH does not depend on a module exporting 'f.h'}} +#include "f.h" // expected-error-re {{module XH does not depend on a module exporting '{{.*}}{{/|\\}}f.h'}} const int h2 = h1+e+f; diff --git a/clang/test/Modules/declare-use3.cpp b/clang/test/Modules/declare-use3.cpp --- a/clang/test/Modules/declare-use3.cpp +++ b/clang/test/Modules/declare-use3.cpp @@ -1,4 +1,4 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -include "g.h" -include "e.h" -include "f.h" -include "i.h" -fimplicit-module-maps -fmodules-cache-path=%t -fmodules-decluse -fmodule-name=XG -I %S/Inputs/declare-use %s -verify -// expected-error {{module XG does not depend on a module exporting 'f.h'}} +// expected-error-re {{module XG does not depend on a module exporting '{{.*}}{{/|\\}}f.h'}} const int g2 = g1 + e + f + aux_i; diff --git a/clang/test/Modules/header-attribs.cpp b/clang/test/Modules/header-attribs.cpp --- a/clang/test/Modules/header-attribs.cpp +++ b/clang/test/Modules/header-attribs.cpp @@ -3,8 +3,8 @@ // RUN: not %clang_cc1 -fmodules -I%S/Inputs/header-attribs -emit-module -x c++-module-map %S/Inputs/header-attribs/modular.modulemap -fmodules-cache-path=%t -fmodule-name=A 2>&1 | FileCheck %s --check-prefix BUILD-MODULAR #include "foo.h" // ok, stats match -#include "bar.h" // expected-error {{does not depend on a module exporting 'bar.h'}} -#include "baz.h" // expected-error {{does not depend on a module exporting 'baz.h'}} +#include "bar.h" // expected-error-re {{does not depend on a module exporting '{{.*}}{{/|\\}}bar.h'}} +#include "baz.h" // expected-error-re {{does not depend on a module exporting '{{.*}}{{/|\\}}baz.h'}} // FIXME: Explain why the 'bar.h' found on disk doesn't match the module map. // BUILD-MODULAR: error: header 'bar.h' not found diff --git a/clang/test/Modules/strict-decluse-headers.cpp b/clang/test/Modules/strict-decluse-headers.cpp --- a/clang/test/Modules/strict-decluse-headers.cpp +++ b/clang/test/Modules/strict-decluse-headers.cpp @@ -14,4 +14,4 @@ // Don't crash on this: (FIXME: we should produce an error that the specified file is not part of the specified module) // RUN: %clang_cc1 -fsyntax-only -fmodules -fmodule-map-file=%t/map -I%t -fmodules-strict-decluse -fmodule-name=X -x c++ %t/foo.h // -// CHECK: module X does not depend on a module exporting 'foo.h' +// CHECK: module X does not depend on a module exporting '{{.*}}{{/|\\}}foo.h' diff --git a/clang/test/Modules/strict-decluse.cpp b/clang/test/Modules/strict-decluse.cpp --- a/clang/test/Modules/strict-decluse.cpp +++ b/clang/test/Modules/strict-decluse.cpp @@ -3,7 +3,7 @@ #include "g.h" #include "e.h" -#include "f.h" // expected-error {{module XG does not depend on a module exporting 'f.h'}} -#include "i.h" // expected-error {{module XG does not depend on a module exporting 'i.h'}} +#include "f.h" // expected-error-re {{module XG does not depend on a module exporting '{{.*}}{{/|\\}}f.h'}} +#include "i.h" // expected-error-re {{module XG does not depend on a module exporting '{{.*}}{{/|\\}}i.h'}} const int g2 = g1 + e + f + aux_i; diff --git a/clang/test/Modules/textual-headers.cpp b/clang/test/Modules/textual-headers.cpp --- a/clang/test/Modules/textual-headers.cpp +++ b/clang/test/Modules/textual-headers.cpp @@ -6,13 +6,13 @@ #include "k.h" #define GIMME_AN_L -#include "l.h" // expected-error {{module XG does not depend on a module exporting 'l.h'}} +#include "l.h" // expected-error-re {{module XG does not depend on a module exporting '{{.*}}{{/|\\}}l.h'}} -#include "m2.h" // expected-error {{module XG does not depend on a module exporting 'm2.h'}} +#include "m2.h" // expected-error-re {{module XG does not depend on a module exporting '{{.*}}{{/|\\}}m2.h'}} const int use_m = m; // expected-error {{undeclared identifier}} #define GIMME_AN_M -#include "m.h" // expected-error {{use of private header from outside its module: 'm.h'}} +#include "m.h" // expected-error-re {{use of private header from outside its module: '{{.*}}{{/|\\}}m.h'}} const int use_m_2 = m; const int g = k + l;