diff options
author | Jason Merrill <jason@redhat.com> | 2018-03-13 16:22:31 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-03-13 16:22:31 -0400 |
commit | 515f874faf45628b1b86da81964f2049f7406326 (patch) | |
tree | 122067c0b75183fdf4e0621ea1676591d3c9918f /gcc/cp | |
parent | f71c1a187b70b88d90263b209ea402fc38d4ec92 (diff) | |
download | gcc-515f874faf45628b1b86da81964f2049f7406326.zip gcc-515f874faf45628b1b86da81964f2049f7406326.tar.gz gcc-515f874faf45628b1b86da81964f2049f7406326.tar.bz2 |
PR c++/82565 - ICE with concepts and generic lambda.
* pt.c (instantiate_decl): Clear fn_context for lambdas.
From-SVN: r258502
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 23079f0..da81495 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2018-03-13 Jason Merrill <jason@redhat.com> + PR c++/82565 - ICE with concepts and generic lambda. + * pt.c (instantiate_decl): Clear fn_context for lambdas. + +2018-03-13 Jason Merrill <jason@redhat.com> + PR c++/84720 - ICE with rvalue ref non-type argument. * pt.c (convert_nontype_argument): Handle rvalue references. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index a16aef6..d720c33 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -23460,6 +23460,9 @@ instantiate_decl (tree d, bool defer_ok, bool expl_inst_class_mem_p) bool push_to_top, nested; tree fn_context; fn_context = decl_function_context (d); + if (LAMBDA_FUNCTION_P (d)) + /* tsubst_lambda_expr resolved any references to enclosing functions. */ + fn_context = NULL_TREE; nested = current_function_decl != NULL_TREE; push_to_top = !(nested && fn_context == current_function_decl); |