forked from OSchip/llvm-project
Issue a bettter diagnostics for incorrect property setter name.
(radar 7647953). llvm-svn: 96284
This commit is contained in:
parent
3e0c140c50
commit
8efe0ec899
|
@ -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">;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue