[PATCH] D27621: [clang-tidy] check to find declarations declaring more than one name

Firat Kasmis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 21 06:17:11 PST 2017


firolino added inline comments.


================
Comment at: clang-tidy/readability/OneNamePerDeclarationCheck.h:25
+class OneNamePerDeclarationCheck : public ClangTidyCheck {
+private:
+  std::string getUserWrittenType(const DeclStmt *DeclStmt, SourceManager &SM);
----------------
firolino wrote:
> alexfh wrote:
> > nit: move the private section to the end.
> [[ http://llvm.org/docs/CodingStandards.html#use-of-class-and-struct-keywords | LLVM Coding Standards ]] is putting the private section at the beginning as well. Even in the code base, it seems to be the general rule. While you are reading code from top to bottom, you need to get the necessary context (variables and their types) first, before proceeding to the functional code. Otherwise, you would have to scroll all the time down to the private variables - when passing its usage in a function - to get its type. This would impair the reading fluency and thus the straight-forwarding understanding of the code.
Or is it, because there is just a function and not a private variable?


https://reviews.llvm.org/D27621





More information about the cfe-commits mailing list