[PATCH] D15710: [clang-tidy] Add non-inline function definition and variable definition check in header files.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 4 05:45:54 PST 2016


aaron.ballman added inline comments.

================
Comment at: clang-tidy/misc/DefinitionsInHeadersCheck.cpp:31
@@ +30,3 @@
+  // inline function with external linkage, class template, non-static function
+  // template, static data member of a class template, member function of a
+  // class template, or template specialization for which some template
----------------
hokein wrote:
> @aaron, what do you mean the AST matcher here? Could you explain it a bit more? 
Currently, your code checks whether something is in the header file as part of the check() callback and early returns out of it; I was suggesting making the header file check part of the AST matcher in registerMatchers() instead, so that check() isn't called on declarations that are outside of a header file at all. This makes the matcher declaratively more accurate, and it could have a (likely minor) positive performance impact.


http://reviews.llvm.org/D15710





More information about the cfe-commits mailing list