Objective-C : Implement NSObject attribute.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 24 Oct 2020 14:51:46 +0000 (15:51 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 7 Nov 2020 11:45:46 +0000 (11:45 +0000)
commit0c30bf43eb2325caa4cb32a697ac1127c15205d7
treeb48fce515527857a67855662c4fde50b90cb6328
parentdf784801daf0185a1e22ebf03d48363530717882
Objective-C : Implement NSObject attribute.

This attribute allows pointers to be marked as pointers to
an NSObject-compatible object.  This allows for additional
checking of assignment etc. when refering to pointers to
opaque types.

gcc/c-family/ChangeLog:

* c-attribs.c (handle_nsobject_attribute): New.
* c.opt: Add WNSObject-attribute.

gcc/objc/ChangeLog:

* objc-act.c (objc_compare_types): Handle NSObject type
attributes.
(objc_type_valid_for_messaging): Likewise.

gcc/testsuite/ChangeLog:

* obj-c++.dg/attributes/nsobject-01.mm: New test.
* objc.dg/attributes/nsobject-01.m: New test.
gcc/c-family/c-attribs.c
gcc/c-family/c.opt
gcc/objc/objc-act.c
gcc/testsuite/obj-c++.dg/attributes/nsobject-01.mm [new file with mode: 0644]
gcc/testsuite/objc.dg/attributes/nsobject-01.m [new file with mode: 0644]