[PATCH] D86581: [clang-format] Handle shifts within conditions

Jake Merdich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 26 07:45:13 PDT 2020


JakeMerdichAMD added a comment.

Agreed that this is a very nice solution for this case. LGTM too assuming it passes @MyDeveloperDay's tests.

Minor heads up: there are still some cases I can dream up where we'd currently spit out invalid code from splitting a right shift even after this fix. Long story short, C++14 made some cases completely ambiguous and impossible to detect without semantic analysis (https://godbolt.org/z/rxEqTG). I'll be having a fix out for that soon, but it's rather complementary to this one-- yours improves template detection, mine acts more conservative in case we guessed wrong about it being a template.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86581



More information about the cfe-commits mailing list