Skip to content

Commit 375efdf

Browse files
committed
Identify if a file is a system header by its path
1 parent cde15fa commit 375efdf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Lex/HeaderSearch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,8 @@ void HeaderSearch::DiagnoseHeaderShadowing(
887887
ArrayRef<std::pair<OptionalFileEntryRef, DirectoryEntryRef>> Includers,
888888
bool isAngled, int IncluderLoopIndex, ConstSearchDirIterator MainLoopIt) {
889889

890-
if (Diags.isIgnored(diag::warn_header_shadowing, IncludeLoc) || isAngled ||
891-
DiagnosedShadowing)
890+
if (Diags.isIgnored(diag::warn_header_shadowing, IncludeLoc) ||
891+
DiagnosedShadowing || (getFileInfo(*FE).DirInfo != SrcMgr::C_User))
892892
return;
893893

894894
DiagnosedShadowing = true;

0 commit comments

Comments
 (0)