[PATCH] D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 26 04:21:55 PDT 2017


djasper added a comment.

In all honesty, I think this style isn't thought out well enough. It really is a special case for only "=" and "return" and even there, it has many cases where it simply doesn't make sense. And then you have cases like this:

  bool = aaaaaa //
      == bbbb //
      && ccccc;

Where the syntactic structure is lost entirely.

On top of that it has runtime downsides for all clang-format users because ParenState gets larger and more costly compare. As such, I am against moving forward with this. Can you remind me again, which coding style suggests this format?



================
Comment at: unittests/Format/FormatTest.cpp:2619
+      "    sizeof(int16_t) // DWARF ARange version number\n"
+      "  + sizeof(int32_t) // Offset of CU in the .debug_info section\n"
+      "  + sizeof(int8_t)  // Pointer Size (in bytes)\n"
----------------
I think this is wrong and we should not indent like this.


https://reviews.llvm.org/D32478





More information about the cfe-commits mailing list