https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107918

            Bug ID: 107918
           Summary: P2468R2 and operator ambiguity
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

I hear that

// Global scope.
template <typename>
struct S {
  friend bool operator==(S&&, const S&) { return true; }
  friend bool operator!=(S&&, const S&) { return true; }
};

using U = S<int>;

bool b = U{} == U{};

shouldn't be ambiguous according to P2468R2
<https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2468r2.html>, but
with -std=c++20 we emit:

warning: C++20 says that these are ambiguous, even though the second is
reversed

Reply via email to