Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg6.C

raw
1 // PR c++/94162
2 // { dg-do compile { target c++20 } }
3
4 #include <compare>
5
6 struct S {
7 int a; // { dg-error "three-way comparison of 'S::a' has type 'std::strong_ordering', which does not convert to 'int\\*'" }
8 int *operator<=>(const S&) const = default; // { dg-error "invalid 'static_cast' from type 'const std::strong_ordering' to type 'int\\*'" }
9 };
10
11 bool b = S{} < S{}; // { dg-error "use of deleted function 'constexpr int\\* S::operator<=>\\\(const S&\\\) const'" }