Skip to content

Commit 8765436

Browse files
committed
Ignore diagnostics from system headers.
1 parent 0312677 commit 8765436

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/Lex/HeaderSearch.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -888,10 +888,11 @@ void HeaderSearch::DiagnoseHeaderShadowing(
888888
bool isAngled, int IncluderLoopIndex, ConstSearchDirIterator MainLoopIt) {
889889

890890
if (Diags.isIgnored(diag::warn_header_shadowing, IncludeLoc) ||
891-
DiagnosedShadowing || (getFileInfo(*FE).DirInfo != SrcMgr::C_User)) {
892-
DiagnosedShadowing = true;
891+
DiagnosedShadowing)
892+
return;
893+
// Ignore diagnostics from system headers.
894+
if (MainLoopIt && MainLoopIt->isSystemHeaderDirectory())
893895
return;
894-
}
895896

896897
DiagnosedShadowing = true;
897898

0 commit comments

Comments
 (0)