revert: cp-lang.c (cxx_types_compatible_p): To the middle-end, references and pointer...
authorJason Merrill <jason@gcc.gnu.org>
Fri, 16 Jul 2004 17:06:56 +0000 (13:06 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 16 Jul 2004 17:06:56 +0000 (13:06 -0400)
revert:
        * cp-lang.c (cxx_types_compatible_p): To the middle-end,
        references and pointers are compatible.

From-SVN: r84820

gcc/cp/ChangeLog
gcc/cp/cp-lang.c

index f34b38ece3c8d4784edb2eb4559dca189ac97328..189ff972bbd828c3a0baabc1c1392c1a795fe3d0 100644 (file)
        (add_conversions): Likewise.
        * semantics.c (finish_member_declaration): Adjust call to add_method.
 
-2004-07-15  Jason Merrill  <jason@redhat.com>
-
-       * cp-lang.c (cxx_types_compatible_p): To the middle-end,
-       references and pointers are compatible.
-
 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
 
        * decl.c (xref_basetypes): Refactor.
index b6e933fede6f8b9ce75fd877d42fed3aafdb31b4..5f38fbb10257e8951f18d7ad9f96830ae36a2015 100644 (file)
@@ -317,23 +317,9 @@ cp_var_mod_type_p (tree type, tree fn)
   return false;
 }
 
-/* This compares two types for equivalence ("compatible" in C-based languages).
-   This routine should only return 1 if it is sure.  It should not be used
-   in contexts where erroneously returning 0 causes problems.  */
-
 static int cxx_types_compatible_p (tree x, tree y)
 {
-  if (same_type_ignoring_top_level_qualifiers_p (x, y))
-    return 1;
-
-  /* Once we get to the middle-end, references and pointers are
-     interchangeable.  FIXME should we try to replace all references with
-     pointers?  */
-  if (POINTER_TYPE_P (x) && POINTER_TYPE_P (y)
-      && same_type_p (TREE_TYPE (x), TREE_TYPE (y)))
-    return 1;
-
-  return 0;
+  return same_type_ignoring_top_level_qualifiers_p (x, y);
 }
 
 /* Construct a C++-aware pretty-printer for CONTEXT.  It is assumed