public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Jason Merrill <jason@redhat.com>
Cc: Nathan Sidwell <nathan@acm.org>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PR c++/86610] lambda captures in templates
Date: Tue, 22 Jan 2019 22:25:00 -0000	[thread overview]
Message-ID: <CAMe9rOrT8WY0yXG7i-dOqYMxWLK10eB+zy1eZnf-taQSR0Gm_g@mail.gmail.com> (raw)
In-Reply-To: <6077ac57-e237-b80d-8e47-76156dd418d3@redhat.com>

On Wed, Jan 16, 2019 at 2:32 PM Jason Merrill <jason@redhat.com> wrote:
>
> On 1/16/19 4:48 PM, Nathan Sidwell wrote:
> > This PR reports a bug where we select a non-const operator function and
> > then apply it to a const object.  That's happening because the
> > expression 'c[0]' is not dependent, so we figure end up resolving it.
> > But the lambda capture logic doesn't capture 'c' at that point and we
> > have a non-const qualified 'c'.  At instantiation time we do the capture
> > and the by-value lambda results in const-qualified captures.
> >
> > Jason, the orginal test in process_outer_var_ref looked a little funky
> > -- why not just processing_template_decl? That would satisfy what the
> > comment says it checking.  Anyway changing the test to check DECL's
> > type-dependency makes the right things happen, and a bootstrap passes.
> > Could you review please.
>
> Hmm, I don't remember exactly my rationale for deferring captures within
> a template, but if this doesn't obviously break anything it seems
> reasonable.  Go ahead.
>

This caused:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88995

We are working on a smaller testcase.

-- 
H.J.

      reply	other threads:[~2019-01-22 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 21:48 Nathan Sidwell
2019-01-16 22:32 ` Jason Merrill
2019-01-22 22:25   ` H.J. Lu [this message]

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=CAMe9rOrT8WY0yXG7i-dOqYMxWLK10eB+zy1eZnf-taQSR0Gm_g@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=nathan@acm.org \
    /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).