for gcc/cp/ChangeLog: * typeck.c (comptypes): when comparing pointer types, check whether referred types match even in strictest modes for gcc/testsuite/ChangeLog: * g++.old-deja/g++.other/typedef5.C: add some more tests involving checks involving function types and aliases Index: gcc/cp/typeck.c =================================================================== RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/typeck.c,v retrieving revision 1.107 diff -u -r1.107 typeck.c --- gcc/cp/typeck.c 1998/09/07 14:25:33 1.107 +++ gcc/cp/typeck.c 1998/09/14 02:10:01 @@ -853,11 +853,9 @@ case REFERENCE_TYPE: t1 = TREE_TYPE (t1); t2 = TREE_TYPE (t2); - if (t1 == t2) - { - val = 1; - break; - } + val = comptypes(t1, t2, strict); + if (val) + break; if (strict <= 0) { if (TREE_CODE (t1) == RECORD_TYPE && TREE_CODE (t2) == RECORD_TYPE) @@ -879,8 +877,6 @@ } return 0; } - else - val = comptypes (t1, t2, strict); break; case FUNCTION_TYPE: Index: gcc/testsuite/g++.old-deja/g++.other/typedef5.C =================================================================== RCS file: /egcs/carton/cvsfiles/egcs/gcc/testsuite/g++.old-deja/g++.other/typedef5.C,v retrieving revision 1.1 diff -u -r1.1 typedef5.C --- gcc/testsuite/g++.old-deja/g++.other/typedef5.C 1998/09/11 21:44:36 1.1 +++ gcc/testsuite/g++.old-deja/g++.other/typedef5.C 1998/09/14 02:10:01 @@ -4,5 +4,13 @@ typedef int t; typedef t* u; +typedef u v; +typedef v* (*w)(t); typedef int t; typedef t* u; +typedef u v; +typedef v* (*w)(t const); // this is ok +typedef v* (*w)(t); // ERROR - covers message `previously declared here' +typedef v* (*const w)(t); // ERROR - invalid redeclaration +typedef v const* (*w)(t); // ERROR - invalid redeclaration +typedef v* const (*w)(t); // ERROR - invalid redeclaration