Issue |
120812
|
Summary |
GH58962 regression: Clang rejects &-qualified member function to be overloaded with const-qualified with mutual exclusive constraints
|
Labels |
clang
|
Assignees |
|
Reporter |
zhihaoy
|
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.
```cpp
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
```
https://godbolt.org/z/vY63TE43K
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs