------- Comment #11 from iains at gcc dot gnu dot org 2010-04-09 10:48 ------- Created an attachment (id=20345) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20345&action=view) Provide template args to structure tags for ObjC++ encode.
Re Comment #1 It seems to me that, whilst there might be issues elsewhere in objc-act.c, the tests in question are clearly intended to confirm that encode_aggregate_within() is doing what is intended. To that end I've made a patch for objc-act.c that uses the approach recommended at comment 1 to attach the template args to the structure tag. This is what the current NeXT-compliant complier does. I've extended the tests in encode-2/3 to check that: (a) the anonymous type is correctly encoded and (b) that recursion through encode_aggregate_within() is operating as well. I'm adding two similar tests to objc.dg/ that perform the same duties for ObjC. (encode-10/11) tested on {powerpc,i686}-apple-darwin and ia32-pc-linux OK for trunk? and eventually branch(es)? objc/ 2010-04-09 Iain Sandoe <ia...@gcc.gnu.org> PR objc++/32052 * objc-act.c (encode_aggregate_within): Encode structure tags with template args for ObjC++. testsuite/ 2010-04-09 Iain Sandoe <ia...@gcc.gnu.org> PR objc++/32052 * obj-c++.dg/encode-2.mm: Remove XFAIL. Add test for anonymous structure and nested declarations. * obj-c++.dg/encode-3.mm: Remove XFAIL. Add test for anonymous structure and nested declarations. Reduce header clutter and use _exit() rather than abort(). * objc.dg/encode-10.m: New. * objc.dg/encode-11.m: New. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32052