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

    <tr>
        <th>Summary</th>
        <td>
            [concepts] unexpected "ambiguous deduction for template arguments"
        </td>
    </tr>

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

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

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

<pre>
    Sample:
```
#include <iostream>
#include <string>

template <bool A = false, bool B = false>
struct foo
{
    constexpr foo() requires (!A && !B) = default;
    constexpr foo() requires (A || B) = delete;

    std::string value = "Hello World!";
};

int main()
{
    foo<> works{};
    std::cout << works.value << std::endl;

    foo fails{};

    return 0;
}
```
https://godbolt.org/z/coxs3PvbE

This fails with:
```
<source>:18:9: error: ambiguous deduction for template arguments of 'foo'
    foo fails{};
        ^
<source>:7:15: note: candidate function [with A = false, B = false]
    constexpr foo() requires (!A && !B) = default;
              ^
<source>:8:15: note: candidate function [with A = false, B = false]
    constexpr foo() requires (A || B) = delete;
```

The same code passes with GCC 12.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFVE2P2yAQ_TX2BTWy8ffBh8TZbY-VWqlnbE8SuhhcPjbb_voOOLvJRllte6hqYRuY4c2b4UGvxp_tFzbNAqJsHSXbKFlHZXJqy5BmXA7CjUCirOPKWA1sirK7W2Y0crk_G8PXAuIzGxx6pQRZY29LdkwYiGhHwtzmYu55OaK5wZKdUie4arN0CD6DksbC06yDndYRbYiGH45rMCSMU4xDS2z4Szfe7kOMsGNO2Cj7CywEqjps5AJFgIUXkDOUsaOvZLZeSkEemXAQlkSUfgIhFPmmtBiREk6cAartFRiXlkyMy4XOjQJ4qlmHxSJHpR-Mt12AvOIyKGdJcO4W59UzrTD14gdyFDdywki4M1xcxzh7aLBOS5K8yueWmg7WzsYHo_fY9mrslbArpfc4-oXvoJ5M9vmxfyWgrwduFgLkyO3hTaWi_pTTQxBQtk5r_DT4EtBaad9hU8_3TjmD-zeitLiSmJwmLwpleu8mkNYQtcMNq4IcqvcrQU5PVNzd5FJ5PoWnIJWXzZoMTI589DF3Ti5MomLj07s-Hpcno9j-mwNwft7KoP4PGbx_7K4EcFILEMMmQHi8lGZmDCy6IR-7jqR0FUObliWtaFrWeTy22dhkDYsttwJaTAFpDTBbg1yJk8gPBgujP79_rh90jp0W7ZXekYXrV4OacCDE4_Pvw6zVd4yCQ26MA1x-X1RlXsaHluV1Rfu6rpK8Z2yo0qSgxbCjfdakDa2TWLAehPHEMaiEIwkQ_nIptjFvaUJp0iRNmiZ1kq-KocKJqq96qPM6LaM8AbxmxMrz8Acx1m2g1Lu9QaPgxpqzEavJ9xJCnTw-c_agdHvkQnA2mZnhrTc8xIFCG1L4DQrp0bI">