Issue 58165
Summary Partial ordering of constrained member functions
Labels new issue
Assignees
Reporter PiliLatiesa
    
```c++
template<typename>
constexpr bool b = true;

template<typename T>
concept C = b<T>;

template<typename T, typename U>
class foo
{
public:
  void bar() const requires C<T> {} // #1
  void bar() const requires (C<T> && C<U>) {} // Subsumes #1
};

template<typename T, typename U>
void bar(foo<T, U> const &) requires C<T> {} // #2

template<typename T, typename U>
void bar(foo<T, U> const &) requires (C<T> && C<U>) {} // Subsumes #2

int main()
{
  foo<int, int> x;
  x.bar(); // Clang reports an ambiguity
  bar(x);  // Clang does not complain
  return 0;
}
```



_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to