[PATCH] D151761: clang-format: Add AlignConsecutiveShortCaseStatements

Galen Elias via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 7 15:49:39 PDT 2023


galenelias marked 6 inline comments as done.
galenelias added inline comments.


================
Comment at: clang/include/clang/Format/Format.h:380
+    }
+    bool operator!=(const ShortCaseStatementsAlignmentStyle &R) const {
+      return !(*this == R);
----------------
HazardyKnusperkeks wrote:
> I'd drop that. We don't have it for any other struct.
> 
> And with C++20 you don't need this anymore (although I don't know when llvm will switch to c++20).
We do have it for `TrailingCommentsAlignmentStyle` and `AlignConsecutiveStyle`, but I will drop it.


================
Comment at: clang/unittests/Format/ConfigParseTest.cpp:321
   CHECK_ALIGN_CONSECUTIVE(AlignConsecutiveDeclarations);
+  CHECK_ALIGN_CONSECUTIVE(AlignConsecutiveShortCaseStatements);
 
----------------
HazardyKnusperkeks wrote:
> You now have to write your own checks for the parsing. (It's just copy & paste.)
Aah, I had missed the `CHECK_PARSE_NESTED_BOOL`s for the existing alignConsecutive options within their macro.  Will fix. Thanks


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

https://reviews.llvm.org/D151761



More information about the cfe-commits mailing list