[PATCH] D100778: [clang-format] Prevent extraneous space insertion in bitshift operators

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 19 11:56:53 PDT 2021


Quuxplusone added inline comments.


================
Comment at: clang/unittests/Format/FormatTest.cpp:7652
 
+  verifyFormat("test < a - 1 >> 1;");
   verifyFormat("test >> a >> b;");
----------------
IMO you should use `"test < a | b >> c;"` as your test case here, to reassure the reader that it doesn't depend on the fact that `... 1;` is visibly not a variable declaration.
Personally I'd also like to see `"test<test<a | b>> c;"` tested on the very next line, to show off the intended difference between the two. (Assuming that I understand the intent of this patch correctly.)
(I also switched to a bitwise operator just for the heck of it; that makes this expression just a //very tiny bit// less implausible — but still highly implausible, to the point where I question why we're special-casing it.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100778



More information about the cfe-commits mailing list