[PATCH] D133942: Clang tidy utility to generate a fix hint for a subsequent expression to the existing one

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 17 02:55:18 PDT 2022


njames93 requested changes to this revision.
njames93 added a comment.
This revision now requires changes to proceed.

There's some merit in this, like wrapping the previous statement in braces.. However, clang-tidy should not focus on the formatting aspect as we have clang-format built in to address formatting decisions, and any special formatting you do in here would likely be undone by the users configuration.
It would also be nice to add in some unittests to demonstrate that braces are currently inserted etc.

How does this handle pathological cases like the statement being the iteration-expression of a for loop, or a init-statement in an if/switch/range-for loop. The documentation looks like it tries to explain that, but it doesn't do a great job IMHO.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133942/new/

https://reviews.llvm.org/D133942



More information about the cfe-commits mailing list