view gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg2.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 1830386684a0
children
line wrap: on
line source

// PR c++/92774
// { dg-do compile { target c++2a } }

#include <compare>

template<typename T>
struct X { };

template<typename T>
bool operator==(const X<T>&, const X<T>&) { return true; }
template<typename T>
bool operator<(const X<T>&, const X<T>&) { return true; }

struct Y
{
  int a;
  X<int> c;

  auto operator <=>(Y const&) const = default; // { dg-error "no match" }
};

void f()
{
  auto x = Y() < Y();		// { dg-error "deleted" }
}