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
This commit is contained in:
Alexandre Oliva 1998-09-15 14:28:07 +00:00 committed by Alexandre Oliva
parent 3d821ea145
commit b6bee398d7
2 changed files with 11 additions and 7 deletions

View file

@ -1,3 +1,8 @@
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>
* cp-tree.h: Revert previous change.

View file

@ -853,11 +853,12 @@ comptypes (type1, type2, strict)
case REFERENCE_TYPE:
t1 = TREE_TYPE (t1);
t2 = TREE_TYPE (t2);
if (t1 == t2)
{
val = 1;
break;
}
/* first, check whether the referred types match with the
required level of strictness */
val = comptypes (t1, t2, strict);
if (val)
break;
/* if they do not, try more relaxed alternatives */
if (strict <= 0)
{
if (TREE_CODE (t1) == RECORD_TYPE && TREE_CODE (t2) == RECORD_TYPE)
@ -879,8 +880,6 @@ comptypes (type1, type2, strict)
}
return 0;
}
else
val = comptypes (t1, t2, strict);
break;
case FUNCTION_TYPE: