Skip to content

Commit db77535

Browse files
committed
fix: use customDiagID
1 parent 430ebb5 commit db77535

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,8 +1702,9 @@ void ASTContext::initSanitizers(const LangOptions &LangOpts,
17021702
SourceManager &SM) {
17031703
std::string Error;
17041704
if (!NoSanitizeL->init(LangOpts.NoSanitizeFiles, Error)) {
1705-
const std::string &Path = LangOpts.NoSanitizeFiles.front();
1706-
SM.getDiagnostics().Report(diag::err_fe_error_reading) << Path << Error;
1705+
auto &Diags = SM.getDiagnostics();
1706+
Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0"))
1707+
<< Error;
17071708
}
17081709
}
17091710

clang/test/Driver/fsanitize-ignorelist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
// Check that a missing file passed to -fsanitize-system-ignorelist triggers a clean error without crashing.
7676
// RUN: not %clang --target=x86_64-linux-gnu -Xclang -fsanitize-system-ignorelist=%t.nonexistent %s -c -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-SYSTEM-IGNORELIST-NOFILE
77-
// CHECK-SYSTEM-IGNORELIST-NOFILE: error: error reading '{{.*[\\/]fsanitize-ignorelist\.c\.tmp\.nonexistent}}': can't open file '{{.*[\\/]fsanitize-ignorelist\.c\.tmp\.nonexistent}}': {{[Nn]o such file or directory}}
77+
// CHECK-SYSTEM-IGNORELIST-NOFILE: error: can't open file '{{.*[\\/]fsanitize-ignorelist\.c\.tmp\.nonexistent}}': {{[Nn]o such file or directory}}
7878
// CHECK-SYSTEM-IGNORELIST-NOFILE-NOT: Stack dump:
7979
// CHECK-SYSTEM-IGNORELIST-NOFILE-NOT: PLEASE submit a bug report
8080
// CHECK-SYSTEM-IGNORELIST-NOFILE-NOT: diagnostic msg:

0 commit comments

Comments
 (0)