From 0744a0c1155bca3b0fee47ad2ac40a2652968bd4 Mon Sep 17 00:00:00 2001 From: jason Date: Mon, 13 Nov 2017 22:12:55 +0000 Subject: Defer folding of *&. * typeck.c (cp_build_fold_indirect_ref): New. (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref. Add 'fold' parameter. * cp-tree.h: Declare cp_build_fold_indirect_ref. * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c, parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it. * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR. (cp_convert_range_for): Likewise. * typeck2.c (build_x_arrow): Use RO_ARROW. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254712 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/parser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/cp/parser.c') diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 77b96376e13..1860bf0f175 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -11931,7 +11931,8 @@ do_range_for_auto_deduction (tree decl, tree range_expr) { iter_decl = build_decl (input_location, VAR_DECL, NULL_TREE, iter_type); - iter_decl = build_x_indirect_ref (input_location, iter_decl, RO_NULL, + iter_decl = build_x_indirect_ref (input_location, iter_decl, + RO_UNARY_STAR, tf_warning_or_error); TREE_TYPE (decl) = do_auto_deduction (TREE_TYPE (decl), iter_decl, auto_node); @@ -12048,7 +12049,7 @@ cp_convert_range_for (tree statement, tree range_decl, tree range_expr, /* The declaration is initialized with *__begin inside the loop body. */ cp_finish_decl (range_decl, - build_x_indirect_ref (input_location, begin, RO_NULL, + build_x_indirect_ref (input_location, begin, RO_UNARY_STAR, tf_warning_or_error), /*is_constant_init*/false, NULL_TREE, LOOKUP_ONLYCONVERTING); @@ -20843,7 +20844,7 @@ inject_this_parameter (tree ctype, cp_cv_quals quals) /* Clear this first to avoid shortcut in cp_build_indirect_ref. */ current_class_ptr = NULL_TREE; current_class_ref - = cp_build_indirect_ref (this_parm, RO_NULL, tf_warning_or_error); + = cp_build_fold_indirect_ref (this_parm); current_class_ptr = this_parm; } -- cgit v1.2.1