* call.c (initialize_reference): Add flags parm.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Sep 2011 18:04:39 +0000 (18:04 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Sep 2011 18:04:39 +0000 (18:04 +0000)
* decl.c (grok_reference_init): Likewise.
(check_initializer): Pass it.
* typeck.c (convert_for_initialization): Likewise.
* cp-tree.h: Adjust.

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

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/typeck.c

index c72d9d0..476173d 100644 (file)
@@ -1,5 +1,11 @@
 2011-09-12  Jason Merrill  <jason@redhat.com>
 
+       * call.c (initialize_reference): Add flags parm.
+       * decl.c (grok_reference_init): Likewise.
+       (check_initializer): Pass it.
+       * typeck.c (convert_for_initialization): Likewise.
+       * cp-tree.h: Adjust.
+
        * cp-tree.h (LOOKUP_NO_RVAL_BIND): New.
        * call.c (conditional_conversion): Use it.
        (reference_binding): Fix handling of xvalues.
index 81c8a90..7912fad 100644 (file)
@@ -8717,7 +8717,7 @@ set_up_extended_ref_temp (tree decl, tree expr, tree *cleanup, tree *initp)
 
 tree
 initialize_reference (tree type, tree expr, tree decl, tree *cleanup,
-                     tsubst_flags_t complain)
+                     int flags, tsubst_flags_t complain)
 {
   conversion *conv;
   void *p;
@@ -8729,7 +8729,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup,
   p = conversion_obstack_alloc (0);
 
   conv = reference_binding (type, TREE_TYPE (expr), expr, /*c_cast_p=*/false,
-                           LOOKUP_NORMAL);
+                           flags);
   if (!conv || conv->bad_p)
     {
       if (complain & tf_error)
index 06572fd..12a2895 100644 (file)
@@ -4757,7 +4757,8 @@ extern tree type_passed_as                        (tree);
 extern tree convert_for_arg_passing            (tree, tree);
 extern bool is_properly_derived_from           (tree, tree);
 extern tree set_up_extended_ref_temp           (tree, tree, tree *, tree *);
-extern tree initialize_reference               (tree, tree, tree, tree *, tsubst_flags_t);
+extern tree initialize_reference               (tree, tree, tree, tree *, int,
+                                                tsubst_flags_t);
 extern tree make_temporary_var_for_ref_to_temp (tree, tree);
 extern tree strip_top_quals                    (tree);
 extern bool reference_related_p                        (tree, tree);
index a68bcb1..dc49eb2 100644 (file)
@@ -71,7 +71,7 @@ static void require_complete_types_for_parms (tree);
 static int ambi_op_p (enum tree_code);
 static int unary_op_p (enum tree_code);
 static void push_local_name (tree);
-static tree grok_reference_init (tree, tree, tree, tree *);
+static tree grok_reference_init (tree, tree, tree, tree *, int);
 static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *,
                         int, int, tree);
 static int check_static_variable_definition (tree, tree);
@@ -4574,7 +4574,8 @@ start_decl_1 (tree decl, bool initialized)
    Quotes on semantics can be found in ARM 8.4.3.  */
 
 static tree
-grok_reference_init (tree decl, tree type, tree init, tree *cleanup)
+grok_reference_init (tree decl, tree type, tree init, tree *cleanup,
+                    int flags)
 {
   tree tmp;
 
@@ -4603,7 +4604,8 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup)
      DECL_INITIAL for local references (instead assigning to them
      explicitly); we need to allow the temporary to be initialized
      first.  */
-  tmp = initialize_reference (type, init, decl, cleanup, tf_warning_or_error);
+  tmp = initialize_reference (type, init, decl, cleanup, flags,
+                             tf_warning_or_error);
   if (DECL_DECLARED_CONSTEXPR_P (decl))
     {
       tmp = cxx_constant_value (tmp);
@@ -5468,7 +5470,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
   else if (!init && DECL_REALLY_EXTERN (decl))
     ;
   else if (TREE_CODE (type) == REFERENCE_TYPE)
-    init = grok_reference_init (decl, type, init, cleanup);
+    init = grok_reference_init (decl, type, init, cleanup, flags);
   else if (init || type_build_ctor_call (type))
     {
       if (!init)
index 9db0ce3..ed52f3c 100644 (file)
@@ -7510,7 +7510,7 @@ convert_for_initialization (tree exp, tree type, tree rhs, int flags,
       if (fndecl)
        savew = warningcount, savee = errorcount;
       rhs = initialize_reference (type, rhs, /*decl=*/NULL_TREE,
-                                 /*cleanup=*/NULL, complain);
+                                 /*cleanup=*/NULL, flags, complain);
       if (fndecl)
        {
          if (warningcount > savew)