[PATCH] D108810: [clang-format] [PR51640] - New AfterEnum brace wrapping changes have cause C# behaviour to change

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 27 02:22:23 PDT 2021


krasimir accepted this revision.
krasimir added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:3803
+      if (Line.startsWith(Keywords.kw_interface) &&
+          Style.BraceWrapping.AfterClass)
+        return true;
----------------
nit: the `&& Style.BraceWrapping.AfterClass` is unnecessary since we've ensured that in the parent `if`. I'd just fold the `kw_interface` case into the previous `if`, and then it seems we can further fold the remaining inner `if` into the parent `if`, resulting in this whole section (lines 3796--3805) turning into a single large `if` statement.


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

https://reviews.llvm.org/D108810



More information about the cfe-commits mailing list