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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Access to private member    |nested requires statement
                   |function from               |causes access to private
                   |requires-clause accepted    |member function

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I am not 100% up to speed on requires statment here but I would assume the
outer requires would cause the inner requires to be slient on access
violations.
E.g the following is accepted without error even:
class A{
   static void f();
};
template <class T> concept t =  requires{ T::f(); };
static_assert( !t<A> );
------ CUT ----
Likewise of this one where we don't have a depdent requires even (clang rejects
it but GCC/MSVC accept it):
class A{
   static void f();
};
template <class T> constexpr bool t =  requires{ A::f(); };
static_assert( !t<A> );
------ CUT ----
But GCC fails with this one but if the above is valid I don't see why the below
is not either:

class A{
   static void f();
};
static_assert( !requires{ A::f(); } );

Reply via email to