diff options
-rw-r--r-- | include/clang/Basic/DiagnosticCommonKinds.td | 3 | ||||
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 3 | ||||
-rw-r--r-- | test/Parser/objc-property-syntax.m | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index 7e14a329dc..66f84dbbba 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -31,6 +31,9 @@ def note_also_found : Note<"also found">; // Parse && Lex def err_expected_colon : Error<"expected ':'">; +def err_expected_colon_after_setter_name : Error< + "method name referenced in property setter attribute " + "must end with ':'">; // Parse && Sema def err_no_declarators : Error<"declaration does not declare anything">; diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 3757ee2f6d..d1c9be233f 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -515,7 +515,8 @@ void Parser::ParseObjCPropertyAttribute(ObjCDeclSpec &DS, DeclPtrTy ClassDecl, DS.setSetterName(Tok.getIdentifierInfo()); ConsumeToken(); // consume method name - if (ExpectAndConsume(tok::colon, diag::err_expected_colon, "", + if (ExpectAndConsume(tok::colon, + diag::err_expected_colon_after_setter_name, "", tok::r_paren)) return; } else { diff --git a/test/Parser/objc-property-syntax.m b/test/Parser/objc-property-syntax.m index b5f57f305f..064a2090b0 100644 --- a/test/Parser/objc-property-syntax.m +++ b/test/Parser/objc-property-syntax.m @@ -5,8 +5,10 @@ }; @property unsigned char bufferedUTF8Bytes[4]; // expected-error {{property cannot have array or function type}} @property unsigned char bufferedUTFBytes:1; // expected-error {{property name cannot be a bitfield}} +@property(nonatomic, retain, setter=ab_setDefaultToolbarItems) MyClass *ab_defaultToolbarItems; // expected-error {{method name referenced in property setter attribute must end with ':'}} @end @implementation MyClass +@dynamic ab_defaultToolbarItems; @end |