aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-synth12.C
blob: 85b478437b8ed2fefc87b7572d6f4f8e7e25132b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// PR c++/98712
// { dg-do run { target c++20 } }

#include <compare>

struct S
{
  int s = 0;
  S(int s) : s(s) {}
  auto operator<=>(const S&) const = default;
};

struct T : S
{
  T(int s) : S(s) {}
  constexpr auto operator<=>(const T&) const = default;
};

int
main()
{
  if (T(0) >= T(1))
    __builtin_abort ();
}