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

    <tr>
        <th>Summary</th>
        <td>
            Clang deduce NTTP incorrectly
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c++,
            clang:frontend,
            accepts-invalid
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          yuanfang-chen
      </td>
    </tr>
</table>

<pre>
    ```cpp
template<int I, int U> struct A {}; 

template<int I>
void f(A<I, I>);
template<int I>
void f(A<I, 5>)=delete; // clang incorrectly think this wins.
                        // But `I` should've been deduced as two different values
                        // so neither f is more specialized than the other. 

void bar() {
    A<5, 5> a3; 
    f(a3);
};
```

GCC & MSVC diagnose this as ambiguous. https://godbolt.org/z/6eP73v51h

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUk1vnDAQ_TXmMgoCg4E9cNiPpMqhVaSmvRszgFuvjbDZKPn1HSDbpJUitcgY24958-aNG9c-16xItqHGkSUnluwDnkcjA7LsqG2Ae8aPsCy-sewWfJhmFWAPrDyw8sSyA2xRH8RmtxtwcbqFjvFqT9BKuWJ8Rwz_HSquoacWDS4hpILf0QBlpO1JrnLThCqYZwiDtj-X2cOTtj7eSOGD55XmMAcgT-7pBT-42bSMlxeEBtFCi-2ssAXpITw5aHXX4YSk-SLNjP6fEngHFnUYcIIOSNrZTQh-RKWl0S9EHgZpaUJwy0_xHy6vjjRyIk_IhrUVv3MuJomrSSCztw4t6GIjnb2zfWvi6_p6F94n-3Q8kugCPn_9fqRaZW-dx81PMkCeG93PbvYxDCGMnmX7rcLetY0zIXZTT7sXegt8KLOLSIeNN8I6LQpRJpUoiqits3aX7WQUdDBYH9c2bkbDl8fHh_ctjebJ1H9lIyvnJlbuTBtjLtfPzTi5HxREW-390hx-J6pMpNFQF22KXKgKs5KLptqpPMtz1aV5teOqaprIyAaNr5k4MM4V44d18MXc5WCRSAK6ydmAtn1DpFI4Bn-jLV0IvQLiFOmaJ5ynSZonSb7jRSzKrsxFoqQsG9FgxvIEz1KbeBG--BZN9VpDM_eeQKN98G-g9F73FnHVR_xyDoOb6udZ2o6U3agBbbQWXa8V_wLptyEn">