From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36761 invoked by alias); 17 Jun 2019 15:48:53 -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 36624 invoked by uid 89); 17 Jun 2019 15:48:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Jun 2019 15:48:34 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 816FEC05B038 for ; Mon, 17 Jun 2019 15:48:29 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 193C24AF; Mon, 17 Jun 2019 15:48:26 +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 x5HFmOtC024748; Mon, 17 Jun 2019 17:48:24 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x5HFmNhJ024747; Mon, 17 Jun 2019 17:48:23 +0200 Date: Mon, 17 Jun 2019 15:48:00 -0000 From: Jakub Jelinek To: Marek Polacek Cc: GCC Patches , Jason Merrill Subject: Re: C++ PATCH for c++/60364 - noreturn after first decl not diagnosed (v3) Message-ID: <20190617154823.GU19695@tucnak> Reply-To: Jakub Jelinek References: <20190615142917.GI5989@redhat.com> <20190615143326.GK19695@tucnak> <20190615143913.GJ5989@redhat.com> <20190616161037.GK5989@redhat.com> <20190616161856.GL19695@tucnak> <20190616163658.GL5989@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190616163658.GL5989@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00967.txt.bz2 On Sun, Jun 16, 2019 at 12:36:58PM -0400, Marek Polacek wrote: > On Sun, Jun 16, 2019 at 06:18:56PM +0200, Jakub Jelinek wrote: > > On Sun, Jun 16, 2019 at 12:10:37PM -0400, Marek Polacek wrote: > > > > Guess I will really have to make the changes to treat [[noreturn]] similarly > > > > to e.g. [[nodiscard]], so that cxx11_attribute_p works. > > > > > > Thus. Changes I've made: > > > * don't treat [[noreturn]] as an equivalent to __attribute__((noreturn)); > > > * for that I had to adjust decl_attributes, it wasn't preserving the > > > C++11 form (a list in another list); fix shadowing while at it; > > > * the above turned up two spots that were wrongly accessing TREE_PURPOSE > > > directly instead of using get_attribute_name; > > > * give error only for [[noreturn]] but not for __attribute__((noreturn)) > > > or [[gnu::noreturn]]. > > > > > > Bootstrapped/regtested on x86_64-linux, ok for trunk? > > > > I'd prefer to defer review of this to Jason, just want to note that I don't > > see any testsuite coverage on mixing declarations with different forms of > > attributes ([[noreturn]] on one decl and __attribute__((noreturn)) or > > [[gnu::noreturn]] on another one or vice versa. > > Added now. I suppose it should compile fine, which it does. I meant also the tests of the new diagnostics, say if you have a decl without any of those attributes, then gnu:: one (or __attribute__ one; that merge decls should be ok) and on third decl [[noreturn]] (shall that diagnose anything or not? As there is no way to differentiate it from the gnu:: attribute on the very first one, I'd say it shouldn't, with the use of the gnu:: or __attribute__ we are already outside of the standard. Jakub