================
@@ -1714,9 +1714,32 @@ void UnwrappedLineParser::parseStructuralElement(
if (!Line->InMacroBody || CurrentLines->size() > 1)
Line->Tokens.begin()->Tok->MustBreakBefore = true;
FormatTok->setFinalizedType(TT_GotoLabelColon);
- parseLabel(Style.IndentGotoLabels);
+ const auto OldLineLevel = Line->Level;
+ switch (Style.IndentGotoLabels) {
+ case FormatStyle::IGLS_NoIndent:
+ Line->Level = 0;
+ break;
+ case FormatStyle::IGLS_OuterIndent:
+ if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0))
+ --Line->Level;
+ break;
+ case FormatStyle::IGLS_HalfIndent:
+ case FormatStyle::IGLS_InnerIndent:
+ break;
+ }
+ nextToken();
+ if (FormatTok->is(tok::semi))
+ nextToken();
+ addUnwrappedLine();
+ Line->Level = OldLineLevel;
if (HasLabel)
*HasLabel = true;
+
+ if (FormatTok->isNot(tok::l_brace)) {
+ // "Rerun" this function, this is e.g. for unbraced control statements.
+ parseStructuralElement();
+ addUnwrappedLine();
+ }
----------------
owenca wrote:
Ditto.
https://github.com/llvm/llvm-project/pull/196815
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits