[clang] [clang] [C++20] Defaulted operator== doesn't lookup in using-directive properly #97087 (PR #99542)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 23 01:47:42 PDT 2024


================
@@ -15,3 +32,9 @@ bool operator==(const Foo &, const Foo &) = default;  // expected-warning {{comp
 
 // Declare the defaulted comparison function as a non-member function. Arguments are passed by value.
 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}}
+
+// Declare the defaulted comparsion function as a non-member function. Arguments are passed by value. Arguments look up NS namespace.
+bool operator==(Y, Y) = default; 
+
+// Declare the defaulted comparsion function as a non-member function. Arguments are passed by value. Arguments look up NS namespace and use template struct.
+bool operator==(Z<X>, Z<X>) = default;
----------------
cor3ntin wrote:

Missing a new line before end of file

https://github.com/llvm/llvm-project/pull/99542


More information about the cfe-commits mailing list