<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55907>55907</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Derived class `using` a member function without ref-qualifier from base class, and having the same member function with ref-qualifier
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dragonroot
      </td>
    </tr>
</table>

<pre>
    The following compiles in gcc but not in clang:

```
struct A {
    void f() {}
};

struct B : A {
    using A::f;
    void f() & {}
};

int main() {
    B b;
    b.f(); //ok in GCC only
}
```
Clang is saying on `b.f()`: `error: call to member function 'f' is ambiguous`

Whether this is an issue with clang or with gcc was asked on [stackoverflow](https://stackoverflow.com/questions/70015603/overloading-a-parent-member-function-without-ref-qualifier-with-a-child-member-f/70024650), and there's currently a consensus there that it's the clang which isn't behaving correctly in this case.

If you believe it's gcc which is wrong, I can open a bug against gcc instead. In the end I think it'd be better if both compilers behaved the same way.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFVMuOozAQ_BpyaYEYEiA5cMhDu8p9pT0bMOCNY2f8SJS_3zKQzGR2pI2Qn93V3dXl1Lq9V78GTp2WUt-E6qnR54uQ3JJQ1DcN1d6R0i5sG8lUHy23UXqI0sdYpPM3bq0zvnG0pajcTSeE31WLlrooW0fZZrwpD7M3FsvdZ7wZYEeI8xXG25DgNmSw3HZPx38jZMV_ogjl6MyE-pTSE2pH9Qt0ncy4OAX0D3z6FOj4ud-TVvL-EeQ7RvaBNBKWLLuH9LUi3H2Awg6VYuLGaBPWDZOSnKYzP9fcUOdV40Rwy0o4lQGLnWvRe-3tM8w0_h64G-DjBhgFO4XRek434Yapf6TNtAvNvTHY2BNvx7TynXWsOekrNx3UEOUH5Dg4d7GB8rHyF4MEWsHZu-c2JGixLtP0LS_SZSAJVlKzFkXHLL4ww5WLp5riR01xyER7Fxvexe-eSdEJXIdT-DSDkO3TZULPVkWeBt6yPaprKZTLwYqlxpsQQt6JQcTKcmW9ne4xMijYjXY4mZm4DaIZQBBkUDqq-cCu0wsAUBOA0OSRyYZZnnzm-djRXXu4SMGv_IE8Mjpj0s1oPBZkeYS7In3hConVvifWQ3nWjeZhwVmb0FGNiXGUdAxB1WlCbREEn3Poquio1qGP0xM1dsqZjyxAX2f0md2TRVst281ywxZOOMmrAzciGKFoa4PSxneEGfl81djcD3rpB3VGn6kGCRPGg_uZr2fw78BekRbeyOpVUT2MfD1LScrrY4ovRv9BG7AdJRzUleebtFwMVbFa8VW-5sty3eUZqxl00b2t0_ptneWbcr2QDK2xFRQdZZnit-kVYA1NL0SVpVmWFmmRZfkqz5N2mafrtE3bt47xuiyiVcrx7yCTkEeiTb8w1ZgSumdxKYV19uMSjIhecT6GAz7z4NBUrWG9VkZrtxijV2P2fwEZTbTk">