summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-err4.C
blob: 00f90ced25554928fc1d2251effabbcaad57a3f4 (plain)
1
2
3
4
5
6
7
// PR c++/94478 - ICE with defaulted comparison operator.
// { dg-do compile { target c++2a } }

struct B {};
bool operator!=(const B&, const B&) = default; // { dg-error "equality comparison operator can only be defaulted in a class definition" }
bool operator==(const B&, const B&) = default; // { dg-error "equality comparison operator can only be defaulted in a class definition" }
bool operator<=>(const B&, const B&) = default; // { dg-error "three-way comparison operator can only be defaulted in a class definition" }