+2015-08-19 Jason Merrill <jason@redhat.com>
+
+ * lambda.c (current_nonlambda_scope): New.
+
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c,
extern tree maybe_resolve_dummy (tree, bool);
extern tree current_nonlambda_function (void);
extern tree nonlambda_method_basetype (void);
+extern tree current_nonlambda_scope (void);
extern void maybe_add_lambda_conv_op (tree);
extern bool is_lambda_ignored_entity (tree);
return TYPE_METHOD_BASETYPE (TREE_TYPE (fn));
}
+/* Like current_scope, but looking through lambdas. */
+
+tree
+current_nonlambda_scope (void)
+{
+ tree scope = current_scope ();
+ for (;;)
+ {
+ if (TREE_CODE (scope) == FUNCTION_DECL
+ && LAMBDA_FUNCTION_P (scope))
+ {
+ scope = CP_TYPE_CONTEXT (DECL_CONTEXT (scope));
+ continue;
+ }
+ else if (LAMBDA_TYPE_P (scope))
+ {
+ scope = CP_TYPE_CONTEXT (scope);
+ continue;
+ }
+ break;
+ }
+ return scope;
+}
+
/* Helper function for maybe_add_lambda_conv_op; build a CALL_EXPR with
indicated FN and NARGS, but do not initialize the return type or any of the
argument slots. */