2011-06-17 Jason Merrill <jason@redhat.com>
+ * parser.c (cp_parser_lambda_expression): Clear
+ LAMBDA_EXPR_THIS_CAPTURE after parsing.
+ * pt.c (tsubst_copy_and_build): Make sure it isn't set.
+
* cp-tree.h (struct tree_lambda_expr): Change common to typed.
Move non-pointers to end of struct.
#define LAMBDA_EXPR_CAPTURE_LIST(NODE) \
(((struct tree_lambda_expr *)LAMBDA_EXPR_CHECK (NODE))->capture_list)
-/* The node in the capture-list that holds the 'this' capture. */
+/* During parsing of the lambda, the node in the capture-list that holds
+ the 'this' capture. */
#define LAMBDA_EXPR_THIS_CAPTURE(NODE) \
(((struct tree_lambda_expr *)LAMBDA_EXPR_CHECK (NODE))->this_capture)
pop_deferring_access_checks ();
+ /* This field is only used during parsing of the lambda. */
+ LAMBDA_EXPR_THIS_CAPTURE (lambda_expr) = NULL_TREE;
+
if (ok)
return build_lambda_object (lambda_expr);
else
= (LAMBDA_EXPR_DISCRIMINATOR (t));
LAMBDA_EXPR_CAPTURE_LIST (r)
= RECUR (LAMBDA_EXPR_CAPTURE_LIST (t));
- LAMBDA_EXPR_THIS_CAPTURE (r)
- = RECUR (LAMBDA_EXPR_THIS_CAPTURE (t));
LAMBDA_EXPR_EXTRA_SCOPE (r)
= RECUR (LAMBDA_EXPR_EXTRA_SCOPE (t));
+ gcc_assert (LAMBDA_EXPR_THIS_CAPTURE (t) == NULL_TREE);
/* Do this again now that LAMBDA_EXPR_EXTRA_SCOPE is set. */
determine_visibility (TYPE_NAME (type));