OSDN Git Service

Fix PR c++/45383
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Nov 2010 16:30:54 +0000 (16:30 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Nov 2010 16:30:54 +0000 (16:30 +0000)
Reverting the fix for PR c++/42260 fixes c++/45383.
This reverts commit r155415.

gcc/cp/
Reverted patch for PR c++/42260
* cp-tree.h (lookup_conversions): Reverted "Add new bool parameter to
declarationE."
* search.c (lookup_conversion): Reverted "Use new bool parameter in
definition".
* call.c (add_builtin_candidates): Reverted "Don't lookup template
          conversion"
(convert_class_to_reference, build_user_type_conversion_1,
 build_op_call): Reverted "Adjust".
* cvt.c (build_expr_type_conversion): Reverted "Likewise".

gcc/testsuite/
Reverted patch for PR c++/42260
* conversion/cast2.C: Reverted New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167248 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/cvt.c
gcc/cp/search.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/conversion/cast2.C [deleted file]

index 6e3bbbe..feb9620 100644 (file)
@@ -1,3 +1,17 @@
+2010-11-29  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/45383
+       Reverted patch for PR c++/42260
+       * cp-tree.h (lookup_conversions): Reverted "Add new bool parameter to
+       declarationE."
+       * search.c (lookup_conversion): Reverted "Use new bool parameter in
+       definition".
+       * call.c (add_builtin_candidates): Reverted "Don't lookup template
+       conversion"
+       (convert_class_to_reference, build_user_type_conversion_1,
+        build_op_call): Reverted "Adjust".
+       * cvt.c (build_expr_type_conversion): Reverted "Likewise".
+
 2010-11-29  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * parser.c (cp_parser_objc_try_catch_finally_statement): Parse
index 5e74bd2..d107a71 100644 (file)
@@ -1093,7 +1093,7 @@ convert_class_to_reference (tree reference_type, tree s, tree expr, int flags)
   if (!expr)
     return NULL;
 
-  conversions = lookup_conversions (s, /*lookup_template_convs_p=*/true);
+  conversions = lookup_conversions (s);
   if (!conversions)
     return NULL;
 
@@ -2464,8 +2464,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
          if (i == 0 && code == MODIFY_EXPR && code2 == NOP_EXPR)
            return;
 
-         convs = lookup_conversions (argtypes[i],
-                                     /*lookup_template_convs_p=*/false);
+         convs = lookup_conversions (argtypes[i]);
 
          if (code == COND_EXPR)
            {
@@ -3028,8 +3027,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
             reference to it)...  */
        }
       else
-       conv_fns = lookup_conversions (fromtype,
-                                      /*lookup_template_convs_p=*/true);
+       conv_fns = lookup_conversions (fromtype);
     }
 
   candidates = 0;
@@ -3585,7 +3583,7 @@ build_op_call (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
                      LOOKUP_NORMAL, &candidates);
     }
 
-  convs = lookup_conversions (type, /*lookup_template_convs_p=*/true);
+  convs = lookup_conversions (type);
 
   for (; convs; convs = TREE_CHAIN (convs))
     {
index 67f4f93..23f594c 100644 (file)
@@ -5161,7 +5161,7 @@ extern int at_function_scope_p                    (void);
 extern bool at_class_scope_p                   (void);
 extern bool at_namespace_scope_p               (void);
 extern tree context_for_name_lookup            (tree);
-extern tree lookup_conversions                 (tree, bool);
+extern tree lookup_conversions                 (tree);
 extern tree binfo_from_vbase                   (tree);
 extern tree binfo_for_vbase                    (tree, tree);
 extern tree look_for_overrides_here            (tree, tree);
index b10e558..c6335a2 100644 (file)
@@ -1503,9 +1503,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain)
   if (!TYPE_HAS_CONVERSION (basetype))
     return NULL_TREE;
 
-  for (conv = lookup_conversions (basetype, /*lookup_template_convs_p=*/true);
-       conv;
-       conv = TREE_CHAIN (conv))
+  for (conv = lookup_conversions (basetype); conv; conv = TREE_CHAIN (conv))
     {
       int win = 0;
       tree candidate;
index 370ddf6..c02800c 100644 (file)
@@ -2440,13 +2440,10 @@ lookup_conversions_r (tree binfo,
    functions in this node were selected.  This function is effectively
    performing a set of member lookups as lookup_fnfield does, but
    using the type being converted to as the unique key, rather than the
-   field name.
-   If LOOKUP_TEMPLATE_CONVS_P is TRUE, the returned TREE_LIST contains
-   the non-hidden user-defined template conversion functions too.  */
+   field name.  */
 
 tree
-lookup_conversions (tree type,
-                   bool lookup_template_convs_p)
+lookup_conversions (tree type)
 {
   tree convs, tpl_convs;
   tree list = NULL_TREE;
@@ -2473,9 +2470,6 @@ lookup_conversions (tree type,
        }
     }
 
-  if (lookup_template_convs_p == false)
-    tpl_convs = NULL_TREE;
-
   for (; tpl_convs; tpl_convs = TREE_CHAIN (tpl_convs))
     {
       tree probe, next;
index 79a12a0..a1ebffb 100644 (file)
@@ -1,5 +1,11 @@
 2010-11-29  Dodji Seketeli  <dodji@redhat.com>
 
+       PR c++/45383
+       Reverted patch for PR c++/42260
+       * conversion/cast2.C: Reverted new test.
+
+2010-11-29  Dodji Seketeli  <dodji@redhat.com>
+
        PR debug/46101
        * g++.dg/debug/dwarf2/typedef5.C: New test
 
diff --git a/gcc/testsuite/g++.dg/conversion/cast2.C b/gcc/testsuite/g++.dg/conversion/cast2.C
deleted file mode 100644 (file)
index 3868d74..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// Contributed by Dodji Seketeli <dodji@redhat.com>
-// Origin: PR c++/42260
-// { dg-do compile }
-
-struct A
-{
-      template<typename T> operator T*();
-};
-
-int i = *A();// { dg-error "no match" }
-