[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
Mon Dec 12 07:58:16 PST 2016


firolino marked 2 inline comments as done.
firolino added inline comments.


================
Comment at: clang-tidy/readability/OneNamePerDeclarationCheck.cpp:133
+    VariableLocation.setBegin(tidy::utils::lexer::findLocationAfterToken(
+        VariableLocation.getEnd(), Tokens, *Result.Context));
+  }
----------------
arphaman wrote:
> If you use `ArrayRef` in `findLocationAfterToken` then you won't need to create a `std::vector` here as you should be able to pass in a constant array `{tok::semi, tok::comma}`
This should even work with std::vector, since we have initializer_lists. I have created Token because of [[ http://llvm.org/docs/CodingStandards.html#do-not-use-braced-initializer-lists-to-call-a-constructor | Do not use Braced Initializer Lists to Call a Constructor ]] and readability reasons.

Anyway, this function isn't included in the newest version :)


https://reviews.llvm.org/D27621





More information about the cfe-commits mailing list