From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113920 invoked by alias); 22 Jan 2019 22:17:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 113676 invoked by uid 89); 22 Jan 2019 22:17:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi1-f181.google.com Received: from mail-oi1-f181.google.com (HELO mail-oi1-f181.google.com) (209.85.167.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Jan 2019 22:17:03 +0000 Received: by mail-oi1-f181.google.com with SMTP id y23so141481oia.4 for ; Tue, 22 Jan 2019 14:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X5msjGmULqeLxeMjXZxZwm+QVD/6v3LOCAzSqKb+7ao=; b=BXMqhNJBSLX2PD6pC+w+V8AtRvJlgeLWY6zktlgqMr/KvQcWZJ9sMOwRXuFuJg1qQI qrzN3hzb2ETgF+OuenDmeVxbw6I4hEHb1rsbnSyG3WJEsmJxaFt9zLkiEPaVCamJH97x dc7rZNdK/grYQ0OLLls0lKVFIbmO5zJPDVDUeLt7xgDH5gKH+ua6ZO2aYEHVrqBlzXFk 1KGjIc3pBFRXZZ8wGO9t4isJiEST2SmKKr0T/j+z5cqV+I/+LUrtQXu3kjDg96dWxDFU k5Z7GCIHkh2muA1nJ7AaD7j8ijtQCWe+ujVkE3kmfN62eCgA06XJZHJePDnzdPO421T3 FG/w== MIME-Version: 1.0 References: <6077ac57-e237-b80d-8e47-76156dd418d3@redhat.com> In-Reply-To: <6077ac57-e237-b80d-8e47-76156dd418d3@redhat.com> From: "H.J. Lu" Date: Tue, 22 Jan 2019 22:25:00 -0000 Message-ID: Subject: Re: [PR c++/86610] lambda captures in templates To: Jason Merrill Cc: Nathan Sidwell , GCC Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg01329.txt.bz2 On Wed, Jan 16, 2019 at 2:32 PM Jason Merrill 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.