From patchwork Sat Dec 15 22:09:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1014009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-492580-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="NbzGuWuw"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43HM5q1fG7z9s47 for ; Sun, 16 Dec 2018 09:09:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version :content-transfer-encoding; q=dns; s=default; b=rnlxpqN9rexLxzfm XWghGZ5hsKSPK8KlOA5mLzLBseappStdcbKohFHuA70Cgx7QjouDDuDzia2VXuzB pFOtdDL0JbYQhV7DDvY4Std5yWFqv3O1+9C9ozpJAWsqA/J4IZzX6LAGsgrDhFdF PS0GE5ogHw+9MM9XYC79QQ9pSFA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version :content-transfer-encoding; s=default; bh=uETtwsImcDZ5+tI7Ulru8X mdTuI=; b=NbzGuWuw+i4zwMtXc081fRbPAZiMfzBnWEBASwQq5xoVb4DwfSaObc YynEunUZQhnRgtVLEmRuYMuGKXLkbB2eoQ9x+geF01lJgPv/mRx4OWMUlNla7LMG amKNf6CgFBWjdzIilIscoghSdGrrlQ+V/G+xY4OgWyJsrmzZ75jBU= Received: (qmail 109852 invoked by alias); 15 Dec 2018 22:09:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 109809 invoked by uid 89); 15 Dec 2018 22:09:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=proxy, jason@redhat.com, sk:polacek, U*jason X-HELO: mail-qt1-f196.google.com Received: from mail-qt1-f196.google.com (HELO mail-qt1-f196.google.com) (209.85.160.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 15 Dec 2018 22:09:19 +0000 Received: by mail-qt1-f196.google.com with SMTP id e5so10227682qtr.12 for ; Sat, 15 Dec 2018 14:09:19 -0800 (PST) Received: from orpheus.redhat.com (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id o128sm4610557qkc.7.2018.12.15.14.09.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Dec 2018 14:09:17 -0800 (PST) From: Jason Merrill To: gcc-patches@gcc.gnu.org Subject: [C++ PATCH] Tiny lambda instantiation tweak. Date: Sat, 15 Dec 2018 17:09:15 -0500 Message-Id: <20181215220915.23180-1-jason@redhat.com> MIME-Version: 1.0 X-IsSubscribed: yes While looking at something else I noticed that we were passing 0 to the "nonclass" parameter here; we might as well pass 1, since capture proxies are always at block scope. Tested x86_64-pc-linux-gnu, applying to trunk. * pt.c (tsubst_expr) [DECL_EXPR]: Ignore class-scope bindings when looking up a capture proxy. --- gcc/cp/pt.c | 5 +++-- gcc/cp/ChangeLog | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) base-commit: 95f61091a1264856c1128b67791843a791cb415f diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 3b378ee9ff4..a5b9fa67666 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -16903,8 +16903,9 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl, tree inst; if (!DECL_PACK_P (decl)) { - inst = lookup_name_real (DECL_NAME (decl), 0, 0, - /*block_p=*/true, 0, LOOKUP_HIDDEN); + inst = lookup_name_real (DECL_NAME (decl), /*prefer_type*/0, + /*nonclass*/1, /*block_p=*/true, + /*ns_only*/0, LOOKUP_HIDDEN); gcc_assert (inst != decl && is_capture_proxy (inst)); } else if (is_normal_capture_proxy (decl)) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 46557bec5c2..3dfaa75cbb5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-12-14 Jason Merrill + + * pt.c (tsubst_expr) [DECL_EXPR]: Ignore class-scope bindings when + looking up a capture proxy. + 2018-12-13 Marek Polacek PR c++/88216 - ICE with class type in non-type template parameter.