================
@@ -37,6 +37,25 @@ These changes are ones which we think may surprise users 
when upgrading to
 Clang |release| because of the opportunity they pose for disruption to existing
 code bases.
 
+- Fix a bug in reversed argument for templated operators.
+  This breaks code in C++20 which was previously accepted in C++17. Eg:
+
+  .. code-block:: cpp
+
+    struct P {};
+    template<class S> bool operator==(const P&, const S&);
+
+    struct A : public P {};
+    struct B : public P {};
+
+    bool ambiguous(A a, B b) { return a == b; } // This equality is now 
ambiguous in C++20.
+
+    template<class S> bool operator!=(const P&, const S&);
+    bool fine(A a, B b) { return a == b; } // Ok. Found a matching operator!=.
+
+  To reduce widespread breakages, as an extension, clang would accept this 
with a
----------------
ilya-biryukov wrote:

NIT: s/clang/Clang to match the rest of the document.

https://github.com/llvm/llvm-project/pull/69595
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to