]> git.ipfire.org Git - thirdparty/gcc.git/commit
objective-c - add instancetype.
authoriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 May 2019 08:27:24 +0000 (08:27 +0000)
committeriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 May 2019 08:27:24 +0000 (08:27 +0000)
commit71dbb9288d418388a82fc0330b0a6eaaa7df0453
tree3377ebdc1bfccee1b67415ffb232730595a1937b
parentb46047afdaeab4f482fd99b0838eae3f0c49eea6
objective-c - add instancetype.

The instancetype has been added as a typedef alias to id
in order to allow diagnosis of cases where a class is used
or returned where an instance is expected.

This adds the typedef, and tests that we can parse it.
It doesn't alter the diagnostics yet.

gcc/objc/

2019-05-18  Iain Sandoe  <iain@sandoe.co.uk>

* objc/objc-act.h (OCTI_INSTANCE_TYPE, OCTI_INSTANCETYPE_NAME): New.
(objc_global_trees): Add instance type and name.
(INSTANCE_TYPEDEF_NAME): New.
* objc/objc-act.c (synth_module_prologue): Build decls for
objc_instancetype_type and objc_instancetype_name.

gcc/testsuite/

2019-05-18  Iain Sandoe  <iain@sandoe.co.uk>

* objc.dg/instancetype-0.m: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271370 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/objc/objc-act.h
gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/instancetype-0.m [new file with mode: 0644]