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