Debian Codegraph @

clang/test/CXX/over/over.match/over.match.best/p2.cpp

raw
1 // RUN: %clang_cc1 -std=c++2a -verify %s
2
3 namespace 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>; // #1
8 int operator<=>(const A&) const & requires X<T> && X<int> = delete; // #2
9 };
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 }