+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)
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
#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);
bool
comptypes (tree t1, tree t2, int strict)
{
+ int retval;
+
if (t1 == t2)
return true;
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: