call.c (initialize_reference): Add flags parm.
authorJason Merrill <jason@redhat.com>
Mon, 12 Sep 2011 18:04:39 +0000 (14:04 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 12 Sep 2011 18:04:39 +0000 (14:04 -0400)
* 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.

From-SVN: r178788

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

index c72d9d07d1753c7e8eef0fa1bec71fc94be3c6f9..476173dbe5ff4870fc9e3d71833e44cfed9bc5d6 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 81c8a908c41195e7cf3b48787faa496576ad0d81..7912fad00c1fc34eb20b2fcde6dca3adf6720721 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 06572fd1f7c1cb40145becb84f609679e6482227..12a289571df00d25e07cfbf18f833f79bc646d21 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 a68bcb12403ab3e9c0c86a2ce6512197e5d3fc81..dc49eb2883ba46bbf3cdc622e511c69f1e7ca9e5 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 9db0ce34214fe75ff1325a41a34df7ad7c6a78b4..ed52f3c4f3f6837496716a637c3ccfa2346f8a92 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)