[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
Sun Dec 11 13:56:07 PST 2016


firolino added inline comments.


================
Comment at: clang-tidy/readability/OneNamePerDeclarationCheck.cpp:246
+
+static std::string getCurrentLineIndent(SourceLocation Loc,
+                                        const SourceManager &SM) {
----------------
malcolm.parsons wrote:
> Should checks care about formatting, or leave to clang-format?
At least, they should not change the formatting and try to preserve it. The user shouldn't be forced to run clang-format multiple times. Moreover, not everyone is using clang-format etc.

Having:
```
const int myvalue( 42 ), value ( 4 );

{
    int a, b, c;
}
```
and getting:
```
const int myvalue(42);
const int value(4);

{
    int a;
int b;
int c;
}
```
seems very unsatisfying to me. This would force a non-formatting-tool user to start using one.


https://reviews.llvm.org/D27621





More information about the cfe-commits mailing list