diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-21 14:56:31 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-21 14:56:31 +0000 |
commit | 832e3993c926bcc4cef0c52ac0ee57862a109146 (patch) | |
tree | d699b4b6ed6349c862784364a90e6f787d63ad9c /gcc/cp/lambda.c | |
parent | 2ac1e8f7fe0b1e8d8e274cf0d635ffddc6b108cd (diff) | |
download | gcc-832e3993c926bcc4cef0c52ac0ee57862a109146.tar.gz |
PR c++/60252
* lambda.c (maybe_resolve_dummy): Don't try to capture this
in declaration context.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207999 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index ad993e9d392..7fe235b5702 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -749,7 +749,10 @@ maybe_resolve_dummy (tree object) if (type != current_class_type && current_class_type && LAMBDA_TYPE_P (current_class_type) - && DERIVED_FROM_P (type, current_nonlambda_class_type ())) + && DERIVED_FROM_P (type, current_nonlambda_class_type ()) + /* If we get here while parsing the parameter list of a lambda, it + will fail, so don't even try (c++/60252). */ + && current_binding_level->kind != sk_function_parms) { /* In a lambda, need to go through 'this' capture. */ tree lam = CLASSTYPE_LAMBDA_EXPR (current_class_type); |