blob: 24bbc74a2d19fdf240d94fef944aa42a9661816f [file] [log] [blame]
// P2085, separate definition of defaulted comparisons
// { dg-do compile { target c++20 } }
namespace X {
struct A {
int i;
friend constexpr bool operator==(const A&,const A&);
};
inline constexpr bool operator==(const A&,const A&)=default;
static_assert (A() == A());
}
namespace Y {
struct A {
int i;
// friend bool operator==(const A&,const A&);
};
inline bool operator==(const A&,const A&)=default; // { dg-error "not a friend" }
}