1 // RUN: %clang_cc1 %s -std=c++23 -verify -Wfloat-equal
5 bool operator==(const Foo
&) const;
6 friend bool operator==(const Foo
&, const Foo
&);
7 friend bool operator==(Foo
, Foo
);
10 // Declare the defaulted comparison function as a member function.
11 bool Foo::operator==(const Foo
&) const = default; // expected-warning {{comparing floating point with == or != is unsafe}} expected-note {{in defaulted equality comparison operator for 'Foo' first required here}}
13 // Declare the defaulted comparison function as a non-member function.
14 bool operator==(const Foo
&, const Foo
&) = default; // expected-warning {{comparing floating point with == or != is unsafe}} expected-note {{in defaulted equality comparison operator for 'Foo' first required here}}
16 // Declare the defaulted comparison function as a non-member function. Arguments are passed by value.
17 bool operator==(Foo
, Foo
) = default; // expected-warning {{comparing floating point with == or != is unsafe}} expected-note {{in defaulted equality comparison operator for 'Foo' first required here}}