================
@@ -3889,10 +3925,20 @@ bool UnwrappedLineParser::parseEnum() {
   if (!Style.AllowShortEnumsOnASingleLine) {
     addUnwrappedLine();
     Line->Level += 1;
+  } else if (Style.IndentPPDirectives ==
+             FormatStyle::PPDIS_BeforeHashWithCode) {
+    // For BeforeHashWithCode, flush the enum declaration as its own
+    // UnwrappedLine (like AllowShortEnumsOnASingleLine=false does) so that
+    // body tokens start in a fresh line.  Each PP-separated segment of the
+    // body can then be emitted at its correct indentation via BWHCCodeLine.
+    addUnwrappedLine();
----------------
HazardyKnusperkeks wrote:

You do the same as the `if`, and then after `parseBracedList` again. Just store 
the condition in a bool, and merge both places.

https://github.com/llvm/llvm-project/pull/186686
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to