aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2017-11-13 17:12:55 -0500
committerJason Merrill <jason@gcc.gnu.org>2017-11-13 17:12:55 -0500
commit04757a2a49bd21c71af386a64591f77c165a0d93 (patch)
tree1abdf8c3ce6efdfe6e521741c681eae3a746db70 /gcc/cp/lambda.c
parentcd920e1348eaa1100b90f378f44e110152816149 (diff)
downloadgcc-04757a2a49bd21c71af386a64591f77c165a0d93.zip
gcc-04757a2a49bd21c71af386a64591f77c165a0d93.tar.gz
gcc-04757a2a49bd21c71af386a64591f77c165a0d93.tar.bz2
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. From-SVN: r254712
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r--gcc/cp/lambda.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index bb6c68a..7c8b640 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -557,8 +557,7 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p,
{
gcc_assert (POINTER_TYPE_P (type));
type = TREE_TYPE (type);
- initializer = cp_build_indirect_ref (initializer, RO_NULL,
- tf_warning_or_error);
+ initializer = cp_build_fold_indirect_ref (initializer);
}
if (dependent_type_p (type))
@@ -862,8 +861,7 @@ maybe_resolve_dummy (tree object, bool add_capture_p)
if (tree lam = resolvable_dummy_lambda (object))
if (tree cap = lambda_expr_this_capture (lam, add_capture_p))
if (cap != error_mark_node)
- object = build_x_indirect_ref (EXPR_LOCATION (object), cap,
- RO_NULL, tf_warning_or_error);
+ object = build_fold_indirect_ref (cap);
return object;
}
@@ -1154,8 +1152,7 @@ maybe_add_lambda_conv_op (tree type)
return expression for a deduced return call op to allow for simple
implementation of the conversion operator. */
- tree instance = cp_build_indirect_ref (thisarg, RO_NULL,
- tf_warning_or_error);
+ tree instance = cp_build_fold_indirect_ref (thisarg);
tree objfn = build_min (COMPONENT_REF, NULL_TREE,
instance, DECL_NAME (callop), NULL_TREE);
int nargs = list_length (DECL_ARGUMENTS (callop)) - 1;