[llvm-bugs] [Bug 48252] New: Adding an operator== breaks implicit operator== generation from defaulted <=>

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Nov 21 14:14:19 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48252

            Bug ID: 48252
           Summary: Adding an operator== breaks implicit operator==
                    generation from defaulted <=>
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: barry.revzin at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Reduced example:

#include <compare>

struct X
{
    auto operator<=>(X const&) const = default;
    auto operator==(int i) const;
};

bool f(X x) {
    return x == x;
}

clang trunk rejects this saying no matching candidate. The presence of the
unrelated operator== seems to prevent the generation of X::operator==(X const&)
const from the defaulted <=>.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201121/e9a08f6e/attachment.html>


More information about the llvm-bugs mailing list