[clang] [clang-tools-extra] [clang-tidy] Avoid matching nodes in system headers (PR #151035)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 28 14:48:17 PDT 2025
================
@@ -1336,6 +1336,45 @@ class MatchASTVisitor : public RecursiveASTVisitor<MatchASTVisitor>,
return false;
}
+ bool isInSystemHeader(const SourceLocation &Loc) {
+ const SourceManager &SM = getASTContext().getSourceManager();
+ return SM.isInSystemHeader(Loc);
+ }
+
+ template <typename T> SourceLocation getNodeLocation(T const &Node) {
----------------
vbvictor wrote:
All other code tends to use `const Type &` instead of `Type const &`, I'd suggest correcting it to general style. (There are many violations in this patch)
https://github.com/llvm/llvm-project/pull/151035
More information about the cfe-commits
mailing list