Commit b6bee398 by Alexandre Oliva Committed by Alexandre Oliva

typeck.c (comptypes): when comparing pointer types...

	* typeck.c (comptypes): when comparing pointer types, check
	whether referred types match even in strictest modes

From-SVN: r22429
parent 3d821ea1
1998-09-15 Alexandre Oliva <oliva@dcc.unicamp.br>
* typeck.c (comptypes): when comparing pointer types, check
whether referred types match even in strictest modes
1998-09-15 Mark Mitchell <mark@markmitchell.com> 1998-09-15 Mark Mitchell <mark@markmitchell.com>
* cp-tree.h: Revert previous change. * cp-tree.h: Revert previous change.
......
...@@ -853,11 +853,12 @@ comptypes (type1, type2, strict) ...@@ -853,11 +853,12 @@ comptypes (type1, type2, strict)
case REFERENCE_TYPE: case REFERENCE_TYPE:
t1 = TREE_TYPE (t1); t1 = TREE_TYPE (t1);
t2 = TREE_TYPE (t2); t2 = TREE_TYPE (t2);
if (t1 == t2) /* first, check whether the referred types match with the
{ required level of strictness */
val = 1; val = comptypes (t1, t2, strict);
break; if (val)
} break;
/* if they do not, try more relaxed alternatives */
if (strict <= 0) if (strict <= 0)
{ {
if (TREE_CODE (t1) == RECORD_TYPE && TREE_CODE (t2) == RECORD_TYPE) if (TREE_CODE (t1) == RECORD_TYPE && TREE_CODE (t2) == RECORD_TYPE)
...@@ -879,8 +880,6 @@ comptypes (type1, type2, strict) ...@@ -879,8 +880,6 @@ comptypes (type1, type2, strict)
} }
return 0; return 0;
} }
else
val = comptypes (t1, t2, strict);
break; break;
case FUNCTION_TYPE: case FUNCTION_TYPE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment