public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107256] New: Contradictory circular noexcept-specifier is accepted
@ 2022-10-14  2:06 de34 at live dot cn
  2022-10-14  9:06 ` [Bug c++/107256] " redi at gcc dot gnu.org
  2022-10-18 19:33 ` mpolacek at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: de34 at live dot cn @ 2022-10-14  2:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107256

            Bug ID: 107256
           Summary: Contradictory circular noexcept-specifier is accepted
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: de34 at live dot cn
  Target Milestone: ---

This code snipet is currently accepted by gcc while the noexcept-specifier
cannot be meaningful.

struct Weird {
    static void f() noexcept(!noexcept(Weird::f())) {}
};

Godbolt link: https://godbolt.org/z/hqnha3aPd

The code was rejected by gcc 9 and earlier versions, but with a seemly
incorrect reason (error: incomplete type 'Weird' used in nested name
specifier). According to CWG DR 1330 and current wording in [class.mem.general]
/7, the noexcept-specifier establishes a complete-class context, so Weird is
complete inside it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/107256] Contradictory circular noexcept-specifier is accepted
  2022-10-14  2:06 [Bug c++/107256] New: Contradictory circular noexcept-specifier is accepted de34 at live dot cn
@ 2022-10-14  9:06 ` redi at gcc dot gnu.org
  2022-10-18 19:33 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2022-10-14  9:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107256

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=107186
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Started to be accepted with commit g:78f7607db4c53f8cfe4653a6c91c0328bc2854c3
Author: Marek Polacek 
Date:   Sat Jun 22 16:14:30 2019

    PR c++/86476 - noexcept-specifier is a complete-class context.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/107256] Contradictory circular noexcept-specifier is accepted
  2022-10-14  2:06 [Bug c++/107256] New: Contradictory circular noexcept-specifier is accepted de34 at live dot cn
  2022-10-14  9:06 ` [Bug c++/107256] " redi at gcc dot gnu.org
@ 2022-10-18 19:33 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-10-18 19:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107256

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-10-18
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-18 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14  2:06 [Bug c++/107256] New: Contradictory circular noexcept-specifier is accepted de34 at live dot cn
2022-10-14  9:06 ` [Bug c++/107256] " redi at gcc dot gnu.org
2022-10-18 19:33 ` mpolacek at gcc dot gnu.org

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).