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

    <tr>
        <th>Summary</th>
        <td>
            [libc++] scoped_allocator_adaptor(Convertible, Convertible) shouldn't be ambiguous
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

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

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

<pre>
    Snippet:

```C++
#include <memory_resource>
#include <vector>
#include <string>
#include <cassert>
#include <scoped_allocator>

using PA = std::pmr::polymorphic_allocator<std::pmr::string>;

int main() {
 std::pmr::monotonic_buffer_resource mr1;
 std::pmr::monotonic_buffer_resource mr2;

    using A = std::scoped_allocator_adaptor<PA, PA>;
    A scoped_alloc = A(&mr1, &mr2);

    std::vector<std::pmr::string, PA> v;
 v.emplace_back("foo");
    assert(v.get_allocator().resource() == &mr1);
    return (v[0].get_allocator().resource() == &mr2);
}
```

Output:

```C++
error: call to constructor of 'A' (aka 'scoped_allocator_adaptor<polymorphic_allocator<basic_string<char, std::char_traits<char>, polymorphic_allocator<char>>>, polymorphic_allocator<basic_string<char, std::char_traits<char>, polymorphic_allocator<char>>>>') is ambiguous
```

[GodBolt](https://godbolt.org/z/1Ev8ch3Wx)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VU2PozgQ_TXFxZqIlEMDBw4k6exxW7uHPUb-IvGMwcgfaHt__crko5Nsp7VzGMkigKvq1XuvcJj3-jAo1UCxhmKbsRiO1jV_sO-TUm6Z5xm38r35c9DjqALQFvIt5JfrS35aG8B1Wqe3SPUgTJSKAN30qrfufe-Ut9EJBfT1s6hJiWDdk00fnB4OTzYF81658CxV2FHJPTPGCnaHMF-j18OBvLUE6Jb4IBM_2o69O99Y895bNx61uC2x-W_kR4t0fQugh0B6pgfACrAmUJ53PwHr7WCDHbTY89h1yl0lI71bXsv-ZCI-9EMIISfSD5wfhdozycYT27cWcEPe2lt2qU5LbpPmcu3M8yU1jBsy3yFg_UkTV-CL889FvYCT6QN-Wqh-NEyoPWfix4yKnbWAd3AJ6DweWE2Lgwo3Ns6OLK5zeTaIbhOPC4f7Uk6F6AaSakGxzqHY_mzJezHK7cNndCvS7zGM8f99cMq5pGBLBDOGBEuEHXxwMQlLbEcAyxawTI2zHyw9fuH2s5nnzGuxv8z5RhyZS85cXUsv9sExHfxlm76miGcFLyGn9UXgL0ZOsWUySnvCeq4P0Ub_hTFQrH-zcm1NgGILWB1DGH3qBHeAu4OV3JqwsO4AuPsHcLd8nSpxpH_9DVhnsqGypjXLVLMs8-KlqsqCZsdGvEgh6rIrkHd1KWkhKyowZ0xix7sSM91gjqt8uayXFRYFXaAsuFxVHa9yxnlOYZWrnmmzMGbqE3ymvY-qKauyWGWGcWX8fMgjGs3FeX4Q06HvmpT0jceDh1VutA_-o0zQwcx_DzdpxZY8HSGsNnaYlAuaG5VsuHusiT_aaOQAWAbC1YfkWXSmeRBTh2PkC2F7wF1q6PzzbXT2uxIBcDeT9IC7mee_AQAA__9tnA0f">