[PATCH] D27621: [clang-tidy] check to find declarations declaring more than one name
Malcolm Parsons via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 13 00:13:40 PST 2016
malcolm.parsons added inline comments.
================
Comment at: clang-tidy/readability/OneNamePerDeclarationCheck.cpp:154
+ if (const auto *MemberPointerT = Type->getAs<MemberPointerType>()) {
+ auto Pos = UserWrittenType.find("::");
+ if (Pos != std::string::npos) { // might be hidden behind typedef etc.
----------------
Can this be confused by comments that contain `::`?
================
Comment at: test/clang-tidy/readability-one-name-per-declaration-simple.cpp:17
+ long ** lint1, lint2 = 0, * lint3, **linn;
+ // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: declaration statement can be split up into single line declarations [readability-one-name-per-declaration]
+ // CHECK-FIXES: {{^ }}long ** lint1;
----------------
You don't need to repeat the whole warning every time.
https://reviews.llvm.org/D27621
More information about the cfe-commits
mailing list