[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 13 02:45:26 PDT 2018


JonasToth added a comment.

In https://reviews.llvm.org/D51949#1232443, @kbobyrev wrote:

> I've been thinking about corner-cases (e.g. don't split `DeclStmt`s within init-statement declaration) a while and it seems that there might be many of them.


Yes, things I am currently thinnking of:

- `if (condition) int i, j, k = function(i,j);` is not allowed to be transformed, as it will change semantics.
- `for(int i, j; ..)` similar case
- the new C++17 if-init
- Everything related with Macros

I want the transformation and run it over with good test-suites and see what happens :)

> I didn't notice https://reviews.llvm.org/D27621 in the first place, it seems to have a solid test suite (and it also does some basic formatting, which is nice). It might be worthy to pick it up where it was left. Alternatively, you might want to pull the test cases from that patch if you don't want to reuse the code.

Totally, the test-suite looks very good. Its missing some VarDecl-FunctionDecl mixing and cases like this, but I plan to at least use the tests. You right with the basic formatting, at least indendation and new lines (as the other check does) are worth it.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51949





More information about the cfe-commits mailing list