LAMBDA_EXPR_CAPTURE_LIST holds the capture-list, including `this'.
LAMBDA_EXPR_THIS_CAPTURE goes straight to the capture of `this', if it exists.
LAMBDA_EXPR_PENDING_PROXIES is a vector of capture proxies which need to
- be pushed once scope returns to the lambda.
- LAMBDA_EXPR_MUTABLE_P signals whether this lambda was declared mutable. */
+ be pushed once scope returns to the lambda. */
DEFTREECODE (LAMBDA_EXPR, "lambda_expr", tcc_exceptional, 0)
/* The declared type of an expression. This is a C++0x extension.
TYPENAME_IS_CLASS_P (in TYPENAME_TYPE)
STMT_IS_FULL_EXPR_P (in _STMT)
TARGET_EXPR_LIST_INIT_P (in TARGET_EXPR)
- LAMBDA_EXPR_MUTABLE_P (in LAMBDA_EXPR)
DECL_FINAL_P (in FUNCTION_DECL)
QUALIFIED_NAME_IS_TEMPLATE (in SCOPE_REF)
CONSTRUCTOR_IS_DEPENDENT (in CONSTRUCTOR)
#define LAMBDA_EXPR_CAPTURES_THIS_P(NODE) \
LAMBDA_EXPR_THIS_CAPTURE(NODE)
-/* Predicate tracking whether the lambda was declared 'mutable'. */
-#define LAMBDA_EXPR_MUTABLE_P(NODE) \
- TREE_LANG_FLAG_1 (LAMBDA_EXPR_CHECK (NODE))
-
/* True iff uses of a const variable capture were optimized away. */
#define LAMBDA_EXPR_CAPTURE_OPTIMIZED(NODE) \
TREE_LANG_FLAG_2 (LAMBDA_EXPR_CHECK (NODE))
LAMBDA_EXPR_THIS_CAPTURE (lambda) = NULL_TREE;
LAMBDA_EXPR_REGEN_INFO (lambda) = NULL_TREE;
LAMBDA_EXPR_PENDING_PROXIES (lambda) = NULL;
- LAMBDA_EXPR_MUTABLE_P (lambda) = false;
return lambda;
}
if (lambda_specs.storage_class == sc_mutable)
{
- LAMBDA_EXPR_MUTABLE_P (lambda_expr) = 1;
quals = TYPE_UNQUALIFIED;
}
else if (lambda_specs.storage_class == sc_static)
= LAMBDA_EXPR_LOCATION (t);
LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (r)
= LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (t);
- LAMBDA_EXPR_MUTABLE_P (r) = LAMBDA_EXPR_MUTABLE_P (t);
if (tree ti = LAMBDA_EXPR_REGEN_INFO (t))
LAMBDA_EXPR_REGEN_INFO (r)
= build_template_info (t, add_to_template_args (TI_ARGS (ti),
void
cxx_print_lambda_node (FILE *file, tree node, int indent)
{
- if (LAMBDA_EXPR_MUTABLE_P (node))
- fprintf (file, " /mutable");
fprintf (file, " default_capture_mode=[");
switch (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (node))
{
if (!TYPE_REF_P (type))
{
- if (!LAMBDA_EXPR_MUTABLE_P (lam))
- type = cp_build_qualified_type (type, (cp_type_quals (type)
- |TYPE_QUAL_CONST));
+ int quals = cp_type_quals (type);
+ tree obtype = TREE_TYPE (DECL_ARGUMENTS (current_function_decl));
+ gcc_checking_assert (!WILDCARD_TYPE_P (non_reference (obtype)));
+ if (INDIRECT_TYPE_P (obtype))
+ quals |= cp_type_quals (TREE_TYPE (obtype));
+ type = cp_build_qualified_type (type, quals);
type = build_reference_type (type);
}
return type;