summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-08-28 08:04:23 +0000
committerDaniel Jasper <djasper@google.com>2013-08-28 08:04:23 +0000
commita15da3068d6e0310ece35618a94e151681b5aa67 (patch)
tree4f7b416df020821cfaca0cb86fcd81e4d6cc51e7 /clang/unittests/Format/FormatTest.cpp
parentfce1b03ee7e64214389ab5e17394cb75d99f77aa (diff)
downloadbcm5719-llvm-a15da3068d6e0310ece35618a94e151681b5aa67.tar.gz
bcm5719-llvm-a15da3068d6e0310ece35618a94e151681b5aa67.zip
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
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 274d6e0064b..24ba93f1b98 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4791,6 +4791,10 @@ TEST_F(FormatTest, FormatObjCImplementation) {
verifyFormat("@implementation Foo (HackStuff)\n"
"+ (id)init {\n}\n"
"@end");
+ verifyFormat("@implementation ObjcClass\n"
+ "- (void)method;\n"
+ "{}\n"
+ "@end");
}
TEST_F(FormatTest, FormatObjCProtocol) {
OpenPOWER on IntegriCloud