[llvm-bugs] [Bug 52186] New: False acceptance of ambiguity in case of multiple inheritance and spaceship operator

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 15 03:26:00 PDT 2021


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

            Bug ID: 52186
           Summary: False acceptance of ambiguity in case of multiple
                    inheritance and spaceship operator
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2b
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fchelnokov 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

The program as follows is accepted in Clang:
```
#include <compare>

struct A { 
    auto operator <=>(const A&) const = default;
    bool operator <(const A&) const = default;
};
struct B { 
    auto operator <=>(const B&) const = default; 
};
struct C : A, B {};
int main() { 
    C c;
    return c < c;
}
```
Demo: https://gcc.godbolt.org/z/5YzvqT3aK

But it shall be an error (as in GCC) due to ambiguity. A more detailed
explanation can be found in this answer:
https://stackoverflow.com/a/69245639/7325599

-- 
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/20211015/b09ff268/attachment.html>


More information about the llvm-bugs mailing list