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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to