aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C
blob: bc0e7a54b7eac21d21447bd413cea7ba46ee8b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/116289
// PR c++/113063
// { dg-do link { target c++20 } }
// A version of spaceship-synth16.C where the local class isn't empty.

#include <compare>

int main() {
  struct X {
    int m = 0;
    auto operator<=>(const X&) const = default;
  };
  X x;
  static_assert(noexcept(x <=> x));
  x <=> x;
  constexpr auto r = X{} <=> X{};
}