[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 3 08:20:33 PDT 2025


================
@@ -1507,11 +1544,17 @@ bool MatchASTVisitor::TraverseStmt(Stmt *StmtNode, DataRecursionQueue *Queue) {
 }
 
 bool MatchASTVisitor::TraverseType(QualType TypeNode) {
+  if (shouldSkipNode(TypeNode))
----------------
Xazax-hun wrote:

> b) overload the function for QualType and directly return true, skipping the logic that ends up checking the default-constructed SourceLocation for being in a system header.

This sounds good to me. 

https://github.com/llvm/llvm-project/pull/151035


More information about the cfe-commits mailing list