aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Format/Format.cpp2
-rw-r--r--unittests/Format/FormatTest.cpp15
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index c20c459675..8faa93cdc7 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -946,6 +946,8 @@ private:
(Left.isNot(tok::identifier) && Left.isNot(tok::kw_sizeof) &&
Left.isNot(tok::kw_typeof) && Left.isNot(tok::kw_alignof));
}
+ if (Left.is(tok::at) && Right.getObjCKeywordID() != tok::objc_not_keyword)
+ return false;
return true;
}
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 34b31d42d2..17e98741fd 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1022,10 +1022,9 @@ TEST_F(FormatTest, FormatForObjectiveCMethodDecls) {
}
TEST_F(FormatTest, ObjCAt) {
- // FIXME: Make the uncommented lines pass.
verifyFormat("@autoreleasepool");
- //verifyFormat("@catch");
- //verifyFormat("@class");
+ verifyFormat("@catch");
+ verifyFormat("@class");
verifyFormat("@compatibility_alias");
verifyFormat("@defs");
verifyFormat("@dynamic");
@@ -1037,17 +1036,17 @@ TEST_F(FormatTest, ObjCAt) {
verifyFormat("@interface");
verifyFormat("@optional");
verifyFormat("@package");
- //verifyFormat("@private");
+ verifyFormat("@private");
verifyFormat("@property");
- //verifyFormat("@protected");
+ verifyFormat("@protected");
verifyFormat("@protocol");
- //verifyFormat("@public");
+ verifyFormat("@public");
verifyFormat("@required");
verifyFormat("@selector");
verifyFormat("@synchronized");
verifyFormat("@synthesize");
- //verifyFormat("@throw");
- //verifyFormat("@try");
+ verifyFormat("@throw");
+ verifyFormat("@try");
EXPECT_EQ("@interface", format("@ interface"));