public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Patrick Palka <patrick@parcs.ath.cx>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix PR c++/66786 (ICE with nested lambdas in variable template)
Date: Sun, 06 Mar 2016 06:42:00 -0000	[thread overview]
Message-ID: <56DBD161.3010507@redhat.com> (raw)
In-Reply-To: <1454908753-15468-1-git-send-email-patrick@parcs.ath.cx>

On 02/08/2016 12:19 AM, Patrick Palka wrote:
> Here, we are calling template_class_depth on a FIELD_DECL corresponding
> to a lambda that is used inside variable template.  template_class_depth
> however does not see that this FIELD_DECL is used inside a variable
> template binding because its chain of DECL_CONTEXTs does not include the
> corresponding VAR_DECL.  So template_class_depth returns the wrong
> template nesting level which causes its callers to malfunction.  In
> particular we strip a template argument level in
> tsubst_copy [FIELD_DECL] when we shouldn't have.
>
> This patch makes template_class_depth look at a lambda type's
> LAMBDA_TYPE_EXTRA_SCOPE field instead of its TYPE_CONTEXT, so that it
> can iterate into an enclosing variable template, if applicable.
>
> Tested on x86_64-pc-linux gnu, no new regressions.  Also tested against
> Boost.  Is this OK to commit?

This is breaking several lambda testcases with -fconcepts on; 
LAMBDA_TYPE_EXTRA_SCOPE can also be a FIELD_DECL or PARM_DECL.  Let's 
just check DECL_P.

Jason

  parent reply	other threads:[~2016-03-06  6:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08  5:19 Patrick Palka
2016-02-15 14:43 ` Patrick Palka
2016-03-02 17:52   ` Patrick Palka
2016-03-04 23:38 ` Jason Merrill
2016-03-06  6:42 ` Jason Merrill [this message]
2016-03-06 14:30   ` Patrick Palka
2016-03-07 14:08     ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56DBD161.3010507@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=patrick@parcs.ath.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).