Open
Description
In the following code
struct A {
A() {}
A(int) = delete;
};
struct B : A {
using A::A;
B(int&&) {}
};
int main() {
B b(1);
}
GCC and MSVC print ambiguity error during constructor selection: neither B(int)
nor B(int&&)
is better than the other. But Clang prefers the constructor defined in B over the inherited one, which looks incorrect. Demo: https://gcc.godbolt.org/z/dnErEenE5
Related discussion: https://stackoverflow.com/q/71196145/7325599