From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126663 invoked by alias); 17 Jan 2020 13:19:30 -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 126654 invoked by uid 89); 17 Jan 2020 13:19:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Jan 2020 13:19:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579267158; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pji3SdizrMOwIuiPDeO8YBrCDbg8HzPnRXAo4TF12h0=; b=BtHifhrAH3zJv0vF83oZkJvLyMgEL28rm2L2ehwAJVjcmOgQFCr00TlY0ycxeVHjHfpcLj UIuMV0xOtPmoqyZprWhFcLtqOz776UPnoGY+mMaJEk8pMrcM9QjahSuQol1QDlI0xSFuC/ NwjdYXTkbXuzfTjXzINgFAPW/UUzT+g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-265-IWCApFvNOuGbQ-Xr8abwTQ-1; Fri, 17 Jan 2020 08:19:17 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53D931800D48 for ; Fri, 17 Jan 2020 13:19:16 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-204-74.brq.redhat.com [10.40.204.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC9BD48; Fri, 17 Jan 2020 13:19:15 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 00HDJED2020682; Fri, 17 Jan 2020 14:19:14 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 00HDJDDv020681; Fri, 17 Jan 2020 14:19:13 +0100 Date: Fri, 17 Jan 2020 14:12:00 -0000 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: Patch ping (was Re: [C++ PATCH] Fix deprecated attribute handling on templates (PR c++/93228)) Message-ID: <20200117131913.GO10088@tucnak> Reply-To: Jakub Jelinek References: <20200110202820.GZ10088@tucnak> MIME-Version: 1.0 In-Reply-To: <20200110202820.GZ10088@tucnak> User-Agent: Mutt/1.11.3 (2019-02-01) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg01037.txt.bz2 Hi! I'd like to ping following patch. Thanks. On Fri, Jan 10, 2020 at 09:28:20PM +0100, Jakub Jelinek wrote: > 2020-01-10 Jakub Jelinek >=20 > PR c++/93228 > * parser.c (cp_parser_template_name): Look up deprecated attribute > in DECL_TEMPLATE_RESULT or its type's attributes. >=20 > * g++.dg/cpp1y/attr-deprecated-3.C: New test. >=20 > --- gcc/cp/parser.c.jj 2020-01-10 17:52:48.084062620 +0100 > +++ gcc/cp/parser.c 2020-01-10 19:15:29.019861630 +0100 > @@ -16882,7 +16882,17 @@ cp_parser_template_name (cp_parser* pars > { > if (TREE_DEPRECATED (decl) > && deprecated_state !=3D DEPRECATED_SUPPRESS) > - warn_deprecated_use (decl, NULL_TREE); > + { > + tree d =3D DECL_TEMPLATE_RESULT (decl); > + tree attr; > + if (TREE_CODE (d) =3D=3D TYPE_DECL) > + attr =3D lookup_attribute ("deprecated", > + TYPE_ATTRIBUTES (TREE_TYPE (d))); > + else > + attr =3D lookup_attribute ("deprecated", > + DECL_ATTRIBUTES (d)); > + warn_deprecated_use (decl, attr); > + } > } > else > { > --- gcc/testsuite/g++.dg/cpp1y/attr-deprecated-3.C.jj 2020-01-10 19:20:44= .165196267 +0100 > +++ gcc/testsuite/g++.dg/cpp1y/attr-deprecated-3.C 2020-01-10 19:20:48.69= 9129148 +0100 > @@ -0,0 +1,13 @@ > +// PR c++/93228 > +// { dg-do compile { target c++14 } } > + > +template > +struct [[deprecated("foo")]] bar {}; // { dg-message "declared here" } > +struct [[deprecated("baz")]] qux {}; // { dg-message "declared here" } > + > +void > +quux () > +{ > + bar b; // { dg-warning "is deprecated: foo" } > + qux c; // { dg-warning "is deprecated: baz" } > +} >=20 Jakub