public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/80750] [concepts] noexcept specifier operands are allowed but ignored in compound requirements
       [not found] <bug-80750-4@http.gcc.gnu.org/bugzilla/>
@ 2020-08-07 17:04 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: redi at gcc dot gnu.org @ 2020-08-07 17:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |10.0
           Keywords|                            |accepts-invalid

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This seems to be fixed, the operand of the noexcept is diagnosed now:


80750.C:2:45: error: expected ';' before '(' token
    2 | concept C = requires { { T::smf() } noexcept(false); };
      |                                             ^
      |                                             ;
80750.C:9:15: error: static assertion failed
    9 | static_assert(C<S1>);
      |               ^~~~~
80750.C:9:15: note: constraints not satisfied
80750.C:2:9:   required by the constraints of 'template<class T> concept const
bool C<T>'
80750.C:2:13:   in requirements  [with T = S1]
80750.C:2:32: note: 'S1::smf()' is not 'noexcept'
    2 | concept C = requires { { T::smf() } noexcept(false); };
      |                          ~~~~~~^~


It started to be rejected with r276764 "Update the concepts implementation to
conform to C++20"

Here's an updated testcase which was previously accepted and is now rejected:

template<typename T>
concept C = requires { { T::smf() } noexcept(false); };
struct S1 {
  static void smf();
};
struct S2 {
  static void smf() noexcept;
};
static_assert(!C<S1>);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-07 17:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-80750-4@http.gcc.gnu.org/bugzilla/>
2020-08-07 17:04 ` [Bug c++/80750] [concepts] noexcept specifier operands are allowed but ignored in compound requirements redi 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).