Commit e495f6b0 by Jason Merrill Committed by Jason Merrill

call.c (initialize_reference): Add flags parm.

	* 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
parent dbbc379e
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.
......
......@@ -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)
......
......@@ -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);
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment