Skip to content

Commit 5aae0ee

Browse files
authored
[clang-tidy] give dummy path when create ClangTidyContext (#134670)
#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: #134502
1 parent 499930e commit 5aae0ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ ClangTidyContext::ClangTidyContext(
167167
AllowEnablingAnalyzerAlphaCheckers(AllowEnablingAnalyzerAlphaCheckers),
168168
EnableModuleHeadersParsing(EnableModuleHeadersParsing) {
169169
// Before the first translation unit we can get errors related to command-line
170-
// parsing, use empty string for the file name in this case.
171-
setCurrentFile("");
170+
// parsing, use dummy string for the file name in this case.
171+
setCurrentFile("dummy");
172172
}
173173

174174
ClangTidyContext::~ClangTidyContext() = default;

0 commit comments

Comments
 (0)