aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg6.C
blob: f4df61ed50884873c8c95facc101f671a69017c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
// PR c++/94162
// { dg-do compile { target c++20 } }

#include <compare>

struct S {
  int a;			// { dg-error "three-way comparison of 'S::a' has type 'std::strong_ordering', which does not convert to 'int\\*'" }
  int *operator<=>(const S&) const = default;	// { dg-error "invalid 'static_cast' from type 'const std::strong_ordering' to type 'int\\*'" }
};

bool b = S{} < S{};		// { dg-error "use of deleted function 'constexpr int\\* S::operator<=>\\\(const S&\\\) const'" }