broke completely Obj-C++. The problem is the new set_underlying_type
call in build_self_reference, which creates a new type variant.
The ObjC FE apparently isn't prepared to see such a type variant in
objc_build_struct, expects that all type variants have already
The following patch fixes it, bootstrapped/regtested on x86_64-linux, fixes
all the recent obj-c++ regressions.
2009-11-27 Jakub Jelinek <jakub@xxxxxxxxxx>
* objc-act.c (objc_build_struct): INIT_TYPE_OBJC_INFO for
type variants that don't have it initialized yet.
--- gcc/objc/objc-act.c.jj 2009-11-18 15:48:40.000000000 +0100
+++ gcc/objc/objc-act.c 2009-11-26 10:41:05.000000000 +0100
@@ -871,9 +871,16 @@ objc_build_struct (tree klass, tree fiel
finish_struct(), and then reinstate it afterwards. */
for (t = TYPE_NEXT_VARIANT (s); t; t = TYPE_NEXT_VARIANT (t))
- = chainon (objc_info,
- build_tree_list (NULL_TREE, TYPE_OBJC_INFO (t)));
+ if (!TYPE_HAS_OBJC_INFO (t))
+ INIT_TYPE_OBJC_INFO (t);
+ TYPE_OBJC_INTERFACE (t) = klass;
+ = chainon (objc_info,
+ build_tree_list (NULL_TREE, TYPE_OBJC_INFO (t)));
/* Point the struct at its related Objective-C class. */