OSDN Git Service

PR c++/41468
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Apr 2010 19:04:09 +0000 (19:04 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 04:52:03 +0000 (13:52 +0900)
* class.c (convert_to_base): Add complain parameter.  Pass
ba_quiet to lookup_base if we don't want errors.
(build_vfield_ref): Pass complain to convert_to_base.
* call.c (convert_like_real): Likewise.
(initialize_reference): Likewise.
(perform_direct_initialization_if_possible): Pass complain to
convert_like_real.
* cp-tree.h: Adjust.

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

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/testsuite/ChangeLog

index a996461..d4b82a9 100644 (file)
@@ -1,3 +1,15 @@
+2010-04-27  Jason Merrill  <jason@redhat.com>
+
+       PR c++/41468
+       * class.c (convert_to_base): Add complain parameter.  Pass
+       ba_quiet to lookup_base if we don't want errors.
+       (build_vfield_ref): Pass complain to convert_to_base.
+       * call.c (convert_like_real): Likewise.
+       (initialize_reference): Likewise.
+       (perform_direct_initialization_if_possible): Pass complain to
+       convert_like_real.
+       * cp-tree.h: Adjust.
+
 2010-04-27  Fabien ChĂȘne  <fabien.chene@gmail.com>
            Jason Merrill  <jason@redhat.com>
 
index 90f84e0..a97f7dc 100644 (file)
@@ -5019,7 +5019,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
          /* Build an expression for `*((base*) &expr)'.  */
          expr = cp_build_unary_op (ADDR_EXPR, expr, 0, complain);
          expr = convert_to_base (expr, build_pointer_type (totype),
-                                 !c_cast_p, /*nonnull=*/true);
+                                 !c_cast_p, /*nonnull=*/true, complain);
          expr = cp_build_indirect_ref (expr, RO_IMPLICIT_CONVERSION, complain);
          return expr;
        }
@@ -5142,7 +5142,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
     case ck_ptr:
       if (convs->base_p)
        expr = convert_to_base (expr, totype, !c_cast_p,
-                               /*nonnull=*/false);
+                               /*nonnull=*/false, complain);
       return build_nop (totype, expr);
 
     case ck_pmem:
@@ -7584,7 +7584,7 @@ perform_direct_initialization_if_possible (tree type,
     expr = convert_like_real (conv, expr, NULL_TREE, 0, 0,
                              /*issue_conversion_warnings=*/false,
                              c_cast_p,
-                             tf_warning_or_error);
+                             complain);
 
   /* Free all the conversions we allocated.  */
   obstack_free (&conversion_obstack, p);
@@ -7810,7 +7810,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup,
                expr = convert_to_base (expr,
                                        build_pointer_type (base_conv_type),
                                        /*check_access=*/true,
-                                       /*nonnull=*/true);
+                                       /*nonnull=*/true, complain);
              expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), init, expr);
            }
          else
index a7ed134..dd89171 100644 (file)
@@ -4569,7 +4569,8 @@ extern void validate_conversion_obstack           (void);
 extern tree build_vfield_ref                   (tree, tree);
 extern tree build_base_path                    (enum tree_code, tree,
                                                 tree, int);
-extern tree convert_to_base                    (tree, tree, bool, bool);
+extern tree convert_to_base                    (tree, tree, bool, bool,
+                                                tsubst_flags_t);
 extern tree convert_to_base_statically         (tree, tree);
 extern tree build_vtbl_ref                     (tree, tree);
 extern tree build_vfn_ref                      (tree, tree);
index 21d9e0d..ce7206a 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-27  Jason Merrill  <jason@redhat.com>
+
+       PR c++/41468
+       * g++.dg/template/sfinae17.C: New.
+
 2010-04-27  Fabien ChĂȘne  <fabien.chene@gmail.com>
 
        * g++.dg/init/pr42844.C: New.