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/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/cp/tree.c') diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index b63f2ae4c5d..c60d54ab01f 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -3841,7 +3841,7 @@ tree build_dummy_object (tree type) { tree decl = build1 (CONVERT_EXPR, build_pointer_type (type), void_node); - return cp_build_indirect_ref (decl, RO_NULL, tf_warning_or_error); + return cp_build_fold_indirect_ref (decl); } /* We've gotten a reference to a member of TYPE. Return *this if appropriate, @@ -5011,7 +5011,7 @@ stabilize_expr (tree exp, tree* initp) exp = cp_build_addr_expr (exp, tf_warning_or_error); init_expr = get_target_expr (exp); exp = TARGET_EXPR_SLOT (init_expr); - exp = cp_build_indirect_ref (exp, RO_NULL, tf_warning_or_error); + exp = cp_build_fold_indirect_ref (exp); if (xval) exp = move (exp); } -- cgit v1.2.1