From b6bee398d7a1f1268eea07a3d33617d916d962a1 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 15 Sep 1998 14:28:07 +0000 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/typeck.c | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2531b0edfb4..6311f9433d9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1998-09-15 Alexandre Oliva + + * typeck.c (comptypes): when comparing pointer types, check + whether referred types match even in strictest modes + 1998-09-15 Mark Mitchell * cp-tree.h: Revert previous change. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 50ab3e6d144..6fc3707160e 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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: -- 2.30.2