21 lines · cpp
1// RUN: %clang_cc1 -std=c++2a -verify %s2 3namespace PR44761 {4 template<typename T> concept X = (sizeof(T) == sizeof(T));5 6 template<typename T> struct A {7 bool operator<(const A&) const & requires X<T>; // #18 int operator<=>(const A&) const & requires X<T> && X<int> = delete; // #29 };10 bool k1 = A<int>() < A<int>(); // prefer more-constrained 'operator<=>'11 // expected-error@-1 {{deleted}}12 // expected-note@#1 {{candidate}}13 // expected-note@#2 {{candidate function has been explicitly deleted}}14 // expected-note@#2 {{candidate function (with reversed parameter order) has been explicitly deleted}}15 bool k2 = A<float>() < A<float>(); // prefer more-constrained 'operator<=>'16 // expected-error@-1 {{deleted}}17 // expected-note@#1 {{candidate}}18 // expected-note@#2 {{candidate function has been explicitly deleted}}19 // expected-note@#2 {{candidate function (with reversed parameter order) has been explicitly deleted}}20}21