From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21118 invoked by alias); 15 Jun 2019 14:33:43 -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 21110 invoked by uid 89); 15 Jun 2019 14:33:43 -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; Sat, 15 Jun 2019 14:33:42 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74FAA307D854 for ; Sat, 15 Jun 2019 14:33:33 +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 1B2E817B79; Sat, 15 Jun 2019 14:33:30 +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 x5FEXSN9014975; Sat, 15 Jun 2019 16:33:28 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x5FEXQcP014974; Sat, 15 Jun 2019 16:33:26 +0200 Date: Sat, 15 Jun 2019 14:33: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 Message-ID: <20190615143326.GK19695@tucnak> Reply-To: Jakub Jelinek References: <20190615142917.GI5989@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190615142917.GI5989@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00881.txt.bz2 On Sat, Jun 15, 2019 at 10:29:17AM -0400, Marek Polacek wrote: > [dcl.attr.noreturn] says "The first declaration of a function shall specify the > noreturn attribute if any declaration of that function specifies the noreturn > attribute" meaning that we should diagnose > > void func (); > void func [[noreturn]] (); > > but we do not. I'd been meaning to issue a hard error for [[noreturn]] and > only a warning for __attribute__((noreturn)) but then I found out that we > treat [[noreturn]] exactly as the GNU attribute, and so cxx11_attribute_p > returns false for it, so I decided to make it a pedwarn for all the cases. > A pedwarn counts as a diagnostic, so we'd be conforming still. > > Bootstrapped/regtested on x86_64-linux, ok for trunk? IMHO we should treat __attribute__((noreturn)) as before without any warnings, just [[noreturn]] that way. There is nothing wrong on declaring it just on second or following declaration, it is an optimization attribute. Jakub