diff options
| -rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/cp/Make-lang.in | 2 | ||||
| -rw-r--r-- | gcc/cp/typeck.c | 9 |
3 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9bd87e1..43c58aa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2004-09-09 Ziemowit Laski <zlaski@apple.com> + + * Make-lang.in (cp/typeck.o): Depend on c-common.h. + * typeck.c: Include c-common.h. + (comptypes): For RECORD_TYPEs, call objc_comptypes() and + return the result if nonnegative. + 2004-09-09 Zack Weinberg <zack@codesourcery.com> * decl2.c (import_export_class) diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 29a533b..27ef4f2 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -240,7 +240,7 @@ cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h output.h $(TM_P_H) \ diagnostic.h gt-cp-typeck2.h cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \ - diagnostic.h convert.h + diagnostic.h convert.h c-common.h cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(TARGET_H) convert.h cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(EXPR_H) \ diagnostic.h intl.h gt-cp-call.h convert.h target.h diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index e62db90..94e903d 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */ #include "diagnostic.h" #include "target.h" #include "convert.h" +#include "c-common.h" static tree convert_for_assignment (tree, tree, const char *, tree, int); static tree cp_pointer_int_sum (enum tree_code, tree, tree); @@ -919,6 +920,8 @@ comp_array_types (tree t1, tree t2, bool allow_redeclaration) bool comptypes (tree t1, tree t2, int strict) { + int retval; + if (t1 == t2) return true; @@ -1014,6 +1017,12 @@ comptypes (tree t1, tree t2, int strict) else if ((strict & COMPARE_DERIVED) && DERIVED_FROM_P (t2, t1)) return true; + /* We may be dealing with Objective-C instances... */ + if (TREE_CODE (t1) == RECORD_TYPE + && (retval = objc_comptypes (t1, t2, 0) >= 0)) + return retval; + /* ...but fall through if we are not. */ + return false; case OFFSET_TYPE: |
