aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C
blob: 9d008f19feac6789aa2d84230fc1a96cb64419bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-do compile { target c++2a } }

struct A
{
  int i;
  bool operator==(A a) const { return i == a.i; }
};

struct B
{
  A a;
  bool operator==(const B&) const = default; // { dg-error "A::operator==" }
};

constexpr bool x = B() == B();	// { dg-error "non-.constexpr" }