re PR c++/9420 (incomplete type incorrectly reported)
authorJason Merrill <jason@redhat.com>
Thu, 13 Mar 2003 21:39:38 +0000 (16:39 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 13 Mar 2003 21:39:38 +0000 (16:39 -0500)
        PR c++/9420
        * search.c (lookup_conversions): Call complete_type here.
        * call.c (implicit_conversion): Not here.

From-SVN: r64332

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/search.c

index 29166882d5fe9aaafc03a7af73280dbb7eb0475a..539ad19f9998e101b2c0c700098895011e79fa71 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-13  Jason Merrill  <jason@redhat.com>
+
+       PR c++/9420
+       * search.c (lookup_conversions): Call complete_type here.
+       * call.c (implicit_conversion): Not here.
+
 2003-03-13  Mark Mitchell  <mark@codesourcery.com>
 
        * decl2.c (do_nonmember_using_decl): Correct handling of
index d6496ad6a900d394d09f977064f7598d2590c6e4..9ed804b439da0fab2e08821cf339577c33abcedc 100644 (file)
@@ -1305,11 +1305,6 @@ implicit_conversion (tree to, tree from, tree expr, int flags)
       || expr == error_mark_node)
     return NULL_TREE;
 
-  /* Make sure both the FROM and TO types are complete so that
-     user-defined conversions are available.  */
-  complete_type (from);
-  complete_type (to);
-
   if (TREE_CODE (to) == REFERENCE_TYPE)
     conv = reference_binding (to, from, expr, flags);
   else
index 3d23766d1527703e226c5a84b8866784d30133d4..7cc1fa1d929be1f00f4ff89b02262fda7d77555d 100644 (file)
@@ -2271,8 +2271,8 @@ lookup_conversions (tree type)
   tree t;
   tree conversions = NULL_TREE;
 
-  if (COMPLETE_TYPE_P (type))
-    bfs_walk (TYPE_BINFO (type), add_conversions, 0, &conversions);
+  complete_type (type);
+  bfs_walk (TYPE_BINFO (type), add_conversions, 0, &conversions);
 
   for (t = conversions; t; t = TREE_CHAIN (t))
     IDENTIFIER_MARKED (DECL_NAME (OVL_CURRENT (TREE_VALUE (t)))) = 0;