diff options
author | Alexandre Oliva <oliva@dcc.unicamp.br> | 1998-09-15 14:28:07 +0000 |
---|---|---|
committer | Alexandre Oliva <oliva@gcc.gnu.org> | 1998-09-15 14:28:07 +0000 |
commit | b6bee398d7a1f1268eea07a3d33617d916d962a1 (patch) | |
tree | 68c8d02d935887306abcefd7c4578fb904f16ca7 /gcc | |
parent | 3d821ea145fe2073e552e48cec4f35c8441e507c (diff) | |
download | gcc-b6bee398d7a1f1268eea07a3d33617d916d962a1.zip gcc-b6bee398d7a1f1268eea07a3d33617d916d962a1.tar.gz gcc-b6bee398d7a1f1268eea07a3d33617d916d962a1.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 13 |
2 files changed, 11 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2531b0e..6311f94 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 50ab3e6..6fc3707 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: |