carlosgalvezp added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/llvmlibc/InlineFunctionDeclCheck.cpp:20 +void InlineFunctionDeclCheck::registerMatchers(MatchFinder *Finder) { + Finder->addMatcher(decl(functionDecl()).bind("func_decl"), this); +} ---------------- ClockMan wrote: > or maybe even better: > Finder->addMatcher(functionDecl(unless(isExpansionInMainFile()), > isInline()).bind("func_decl"), this); > Instead of line 26 and 32. I'm not sure that works - if we pass a header directly to clang-tidy, it will consider it as the "main file", right? That's why the established pattern is based on `HeaderFileExtensions`, please check out other checks. ================ Comment at: clang-tools-extra/clang-tidy/llvmlibc/InlineFunctionDeclCheck.cpp:29 + + auto SrcBegin = FuncDecl->getSourceRange().getBegin(); + // Consider functions only in header files. ---------------- Eugene.Zelenko wrote: > Please don't use `auto` unless type is explicitly stated in same statement or > iterator. We have a well-established pattern for detecting code in headers, grep for `HeaderFileExtensions` in existing checks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142592/new/ https://reviews.llvm.org/D142592 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits