add parsing for ObjC* method & method parm attributes
commitf7e71da52f7d29cd3bdb81815026d0daf8bbbb9e
authorIain Sandoe <iains@gcc.gnu.org>
Tue, 28 Sep 2010 21:02:38 +0000 (28 21:02 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Tue, 28 Sep 2010 21:02:38 +0000 (28 21:02 +0000)
tree0b58ec78878b5ec817b8d9d6545ff6e30a03c52c
parentf0a0390e691ece0d859b7d87c6e6617d227cb8dd
add parsing for ObjC* method & method parm attributes

gcc/cp:

Partially merged from apple/trunk branch on FSF servers:
2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
Radar 3803157 (method attributes)

* parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
(cp_parser_objc_method_tail_params_opt): Likewise.
(cp_parser_objc_method_signature): Likewise.
(cp_parser_objc_method_maybe_bad_prefix_attributes): New.
(cp_parser_objc_method_prototype_list): Handle attributes.
(cp_parser_objc_method_definition_list): Likewise.

gcc/objc:

* objc-act.c (objc_add_method_declaration): Handle attributes.
(objc_start_method_definition): Likewise.
(objc_generate_cxx_ctor_or_dtor): Pass NULL attributes to ctor/dtor.
(objc_build_keyword_decl): Handle attributes.

gcc:

* c-parser.c (c_parser_declaration_or_fndef): Diagnose incorrect prefix
attributes on methods.
 (c_parser_objc_method_definition): Handle attributes.
(c_parser_objc_methodproto): Likewise.
(c_parser_objc_maybe_method_attributes): New.
(c_parser_objc_method_decl): Handle attributes, add a similar diagnostic
to ObjC++ for a missing definition.

gcc/c-family:

* c-common.h: Update declarations to include attributes.
* stub-objc.c: Likewise.

testsuite:

* objc.dg/attributes/method-attribute-1.m: New.
* objc.dg/attributes/method-attribute-2.m: New.

* obj-c++.dg/attributes/method-attribute-1.m: New.
* obj-c++.dg/attributes/method-attribute-2.m: New.

From-SVN: r164702
14 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.h
gcc/c-family/stub-objc.c
gcc/c-parser.c
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/testsuite/ChangeLog
gcc/testsuite/obj-c++.dg/attributes/method-attribute-1.mm [new file with mode: 0644]
gcc/testsuite/obj-c++.dg/attributes/method-attribute-2.mm [new file with mode: 0644]
gcc/testsuite/objc.dg/attributes/method-attribute-1.m [new file with mode: 0644]
gcc/testsuite/objc.dg/attributes/method-attribute-2.m [new file with mode: 0644]