Skip to content

Commit 5849dd8

Browse files
committed
[clang-tidy] give dummy path when create ClangTidyContext
llvm#121323 changed the way the absolute path is computed. Empty file name will cause absolute path ignore current folder. This patch add "dummy" file name to avoid this issue Fixed: llvm#134502
1 parent bafa2f4 commit 5849dd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ ClangTidyContext::ClangTidyContext(
166166
AllowEnablingAnalyzerAlphaCheckers(AllowEnablingAnalyzerAlphaCheckers),
167167
EnableModuleHeadersParsing(EnableModuleHeadersParsing) {
168168
// Before the first translation unit we can get errors related to command-line
169-
// parsing, use empty string for the file name in this case.
170-
setCurrentFile("");
169+
// parsing, use dummy string for the file name in this case.
170+
setCurrentFile("dummy");
171171
}
172172

173173
ClangTidyContext::~ClangTidyContext() = default;

0 commit comments

Comments
 (0)