diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-01-31 15:10:41 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-01-31 15:10:41 +0000 |
commit | 7f357c61640fc1558985eeca7a66cbe2c0f1ba0f (patch) | |
tree | 3d604b4184e9611d9c196a1136cc32ae6be34e40 /gcc/cp/lambda.c | |
parent | 8eedca0df166131d7999cec1ba7c83bac8e681c8 (diff) | |
download | gcc-7f357c61640fc1558985eeca7a66cbe2c0f1ba0f.zip gcc-7f357c61640fc1558985eeca7a66cbe2c0f1ba0f.tar.gz gcc-7f357c61640fc1558985eeca7a66cbe2c0f1ba0f.tar.bz2 |
re PR c++/79264 (ICE verify_type failed)
PR c++/79264
* lambda.c (maybe_generic_this_capture): Deal with
template-id-exprs.
* semantics.c (finish_member_declaration): Assert class is being
defined.
PR c++/79264
* g++.dg/cpp1y/pr61636-1.C: Augment.
From-SVN: r245065
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 538c806..46ab30f 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -849,13 +849,21 @@ maybe_generic_this_capture (tree object, tree fns) interest. */ if (BASELINK_P (fns)) fns = BASELINK_FUNCTIONS (fns); + bool id_expr = TREE_CODE (fns) == TEMPLATE_ID_EXPR; + if (id_expr) + fns = TREE_OPERAND (fns, 0); for (; fns; fns = OVL_NEXT (fns)) - if (DECL_NONSTATIC_MEMBER_FUNCTION_P (OVL_CURRENT (fns))) - { - /* Found a non-static member. Capture this. */ - lambda_expr_this_capture (lam, true); - break; - } + { + tree fn = OVL_CURRENT (fns); + + if ((!id_expr || TREE_CODE (fn) == TEMPLATE_DECL) + && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)) + { + /* Found a non-static member. Capture this. */ + lambda_expr_this_capture (lam, true); + break; + } + } } } |