Open
Description
Worked in: Clang 17
Stop working since: Clang 18
Symptom
Clang 18.1.0 and trunk reject the following program in -std=c++20
, but accept it in -std=c++23
. Clang 17.1.0 accepts it in -std=c++20
, so does GCC and MSVC.
namespace GH58962_alt
{
template <unsigned R> struct type
{
void func() const
requires(R == 0);
void func() &
requires(R == 1);
};
template <typename T>
concept test = requires(T v) { decltype(v)(v).func(); };
static_assert(test<type<0> &>);
static_assert(test<type<0> &&>);
static_assert(test<type<1> &>);
static_assert(not test<type<1> &&>);
static_assert(test<type<0> const &>);
static_assert(test<type<0> const &&>);
static_assert(not test<type<1> const &>);
static_assert(not test<type<1> const &&>);
} // namespace GH58962_alt