From e299f547a3be7b860ea323ebc981a028abc20dcb Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Mon, 29 Aug 2016 20:46:59 +0000 Subject: [PATCH] Fix a bug preventing the cause for a module file-not-found from being displayed git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280010 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Serialization/ASTReader.cpp | 2 +- test/Modules/explicit-build.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 753365bf02..f8e4384c63 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -3757,7 +3757,7 @@ ASTReader::ReadASTCore(StringRef FileName, // Otherwise, return an error. Diag(diag::err_module_file_not_found) << moduleKindForDiagnostic(Type) - << FileName << ErrorStr.empty() + << FileName << !ErrorStr.empty() << ErrorStr; return Failure; diff --git a/test/Modules/explicit-build.cpp b/test/Modules/explicit-build.cpp index df9c346588..16eb604708 100644 --- a/test/Modules/explicit-build.cpp +++ b/test/Modules/explicit-build.cpp @@ -167,7 +167,7 @@ // RUN: -fmodule-file=%t/nonexistent.pcm \ // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-FILE %s // -// CHECK-NO-FILE: fatal error: module file '{{.*}}nonexistent.pcm' not found +// CHECK-NO-FILE: fatal error: module file '{{.*}}nonexistent.pcm' not found: module file not found // RUN: mv %t/a.pcm %t/a-tmp.pcm // RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ -- 2.40.0