[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
Mon Dec 12 10:04:13 PST 2016


malcolm.parsons added inline comments.


================
Comment at: clang-tidy/readability/OneNamePerDeclarationCheck.cpp:86
+
+      Diag << FixItHint::CreateReplacement(CommaRange, ";")
+           << FixItHint::CreateReplacement(AfterCommaToVarNameRange,
----------------
A `SourceLocation` can be implicitly converted to a `SourceRange`.


================
Comment at: clang-tidy/readability/OneNamePerDeclarationCheck.cpp:87
+      Diag << FixItHint::CreateReplacement(CommaRange, ";")
+           << FixItHint::CreateReplacement(AfterCommaToVarNameRange,
+                                           "\n" + CurrentIndent +
----------------
Is an insert simpler?
```
FixItHint::CreateInsertion(CommaLocation.getLocWithOffset(1),
                           "\n" + CurrentIndent + UserWrittenType + " ");
```


https://reviews.llvm.org/D27621





More information about the cfe-commits mailing list