public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Marek Polacek <polacek@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Jason Merrill <jason@redhat.com>
Subject: Re: C++ PATCH for c++/60364 - noreturn after first decl not diagnosed (v3)
Date: Mon, 17 Jun 2019 15:48:00 -0000	[thread overview]
Message-ID: <20190617154823.GU19695@tucnak> (raw)
In-Reply-To: <20190616163658.GL5989@redhat.com>

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

  reply	other threads:[~2019-06-17 15:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-15 14:29 C++ PATCH for c++/60364 - noreturn after first decl not diagnosed Marek Polacek
2019-06-15 14:33 ` Jakub Jelinek
2019-06-15 14:39   ` Marek Polacek
2019-06-16 16:10     ` C++ PATCH for c++/60364 - noreturn after first decl not diagnosed (v2) Marek Polacek
2019-06-16 16:19       ` Jakub Jelinek
2019-06-16 16:37         ` C++ PATCH for c++/60364 - noreturn after first decl not diagnosed (v3) Marek Polacek
2019-06-17 15:48           ` Jakub Jelinek [this message]
2019-06-17 18:15             ` Marek Polacek
2019-06-17 15:02       ` C++ PATCH for c++/60364 - noreturn after first decl not diagnosed (v2) Martin Sebor
2019-06-17 18:11         ` Marek Polacek
2019-06-19 19:31           ` Jeff Law
2019-06-20 16:44           ` Joseph Myers
2019-06-20 16:49             ` Marek Polacek
2019-06-20 17:08               ` Joseph Myers
2019-06-20 17:14                 ` Marek Polacek
2019-06-20 17:57               ` Jakub Jelinek
2019-06-20 19:12                 ` Marek Polacek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190617154823.GU19695@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=polacek@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).