aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-03-08 11:03:48 -0500
committerJason Merrill <jason@gcc.gnu.org>2013-03-08 11:03:48 -0500
commit0ef811d71e69f732716e92c81d157aa1c88e7e22 (patch)
tree625454b1e858550bbc542f3e02625cff0632d3a5 /gcc/cp/tree.c
parente48243d8403c76cd248a97c94d138936d856d543 (diff)
downloadgcc-0ef811d71e69f732716e92c81d157aa1c88e7e22.zip
gcc-0ef811d71e69f732716e92c81d157aa1c88e7e22.tar.gz
gcc-0ef811d71e69f732716e92c81d157aa1c88e7e22.tar.bz2
re PR c++/51494 (Legal program rejection - capturing "this" when using static method inside lambda)
PR c++/51494 PR c++/51884 PR c++/56222 * tree.c (maybe_dummy_object): Don't capture 'this'. * semantics.c (maybe_resolve_dummy): New. (finish_non_static_data_member): Use it. (finish_qualified_id_expr): Don't test is_dummy_object. * cp-tree.h: Declare maybe_resolve_dummy. * call.c (build_new_method_call_1): Use it. From-SVN: r196549
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index b57b44a..178b80a 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2863,13 +2863,6 @@ maybe_dummy_object (tree type, tree* binfop)
&& (same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (current_class_ref), context)))
decl = current_class_ref;
- else if (current != current_class_type
- && context == nonlambda_method_basetype ())
- /* In a lambda, need to go through 'this' capture. */
- decl = (build_x_indirect_ref
- (input_location, (lambda_expr_this_capture
- (CLASSTYPE_LAMBDA_EXPR (current_class_type))),
- RO_NULL, tf_warning_or_error));
else
decl = build_dummy_object (context);