[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 10:01:08 PDT 2018


JonasToth updated this revision to Diff 165321.
JonasToth added a comment.

This is the newer and better working code to slice and separate multiple
vardecls in a multi-decl stmt.
I want this version only for now, as the multiple variable definitions in one
statement are by far the most common variant of the single-decl-per-stmt rule.

All other cases are supposed to be diagnosed only.
The next steps will be:

- add the testsuite of the other abondended check
- dont fixit for places like `for(int start = 0, end = 42; ...)`

This patch includes:

- do proper transformations for normal vardecls
- finalize current tests and trim right whitespace of last generated replacement


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51949

Files:
  clang-tidy/readability/CMakeLists.txt
  clang-tidy/readability/IsolateDeclCheck.cpp
  clang-tidy/readability/IsolateDeclCheck.h
  clang-tidy/readability/ReadabilityTidyModule.cpp
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/readability-isolate-decl.rst
  test/clang-tidy/readability-isolate-decl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51949.165321.patch
Type: text/x-patch
Size: 14795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180913/6f5aeb7f/attachment-0001.bin>


More information about the cfe-commits mailing list