clang-format: Fix corner case in ObjC interface definitions.
In
@implementation ObjcClass
- (void)method;
{
}
@end
the ObjC compiler seems to accept the superfluous comma after "method",
but clang-format used to assert on the subsequent "{".
This fixes llvm.org/PR16604.
llvm-svn: 189453
This commit is contained in:
@@ -1030,7 +1030,13 @@ void UnwrappedLineParser::parseObjCUntilAtEnd() {
|
||||
addUnwrappedLine();
|
||||
break;
|
||||
}
|
||||
parseStructuralElement();
|
||||
if (FormatTok->is(tok::l_brace)) {
|
||||
parseBlock(/*MustBeDeclaration=*/false);
|
||||
// In ObjC interfaces, nothing should be following the "}".
|
||||
addUnwrappedLine();
|
||||
} else {
|
||||
parseStructuralElement();
|
||||
}
|
||||
} while (!eof());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user