From d063960a98093c7db9d5032eb54eebb598e44e0f Mon Sep 17 00:00:00 2001 From: Ziemowit Laski Date: Thu, 9 Sep 2004 22:53:51 +0000 Subject: [PATCH] Make-lang.in (cp/typeck.o): Depend on c-common.h. [gcc/cp/ChangeLog] 2004-09-09 Ziemowit Laski * 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. From-SVN: r87259 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/Make-lang.in | 2 +- gcc/cp/typeck.c | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9bd87e1aad4..43c58aa5ed0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2004-09-09 Ziemowit Laski + + * 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 * decl2.c (import_export_class) diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 29a533bd849..27ef4f28f6e 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 e62db90e0d0..94e903db1c8 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: -- 2.30.2