clang-format: Fix case-indentation in macros.
Before:
#define OPERATION_CASE(name) \
case OP_name: \
return operations::Operation##name
After:
#define OPERATION_CASE(name) \
case OP_name: \
return operations::Operation##name
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189743 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp
index fb63899..a149c18 100644
--- a/lib/Format/UnwrappedLineParser.cpp
+++ b/lib/Format/UnwrappedLineParser.cpp
@@ -235,8 +235,9 @@
break;
case tok::kw_default:
case tok::kw_case:
- if (!SwitchLabelEncountered)
- Line->Level += Style.IndentCaseLabels;
+ if (!SwitchLabelEncountered &&
+ (Style.IndentCaseLabels || (Line->InPPDirective && Line->Level == 1)))
+ ++Line->Level;
SwitchLabelEncountered = true;
parseStructuralElement();
break;
@@ -864,8 +865,6 @@
}
void UnwrappedLineParser::parseLabel() {
- if (FormatTok->Tok.isNot(tok::colon))
- return;
nextToken();
unsigned OldLineLevel = Line->Level;
if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0))