[clang] New indent pp directives before hash with code (PR #186686)
Guy Turcotte via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 15 13:31:12 PDT 2026
================
@@ -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();
----------------
turgu1 wrote:
Done
https://github.com/llvm/llvm-project/pull/186686
More information about the cfe-commits
mailing list