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

    <tr>
        <th>Summary</th>
        <td>
            Clang chooses specialization over primary template for non-type template parameter
        </td>
    </tr>

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

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

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

<pre>
    In the following program clang uses the specialization instead of the primary template for `S<20> s1;`. [Demo](https://godbolt.org/z/3ad7P75hc)

```
template<auto N> class S
{
public:
    S() { std::cout << "auto template" << std::endl; }
};

template<char N> class S<N>
{
public:
    S() { std::cout << "char template" << std::endl; }
};

int main()
{
    S<20> s1; //clang uses char template while gcc uses the primary template
   S<'c'> s2; //char template

}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytU8uumzAQ_RqzsW5kTHgtWOTRSt1UlfIFxkzAlbGRbW6U-_UdnHfUXYsMeBhzzhnNmdZ25-aHoWEAerRa25MyPZ2c7Z0YqdQCo9mDjwf8BFIJrb5EUNZQZXwA0VF7jNnJqVG4Mw0wTlqEBc9RUrADyXackewb9SnJtvhlRUm-3cNoSb4nvBpCmDzJNoR_x9XbrrU6rKzrMfrCOxNd-avMB0l4TdiesM31WbDriuGNF-nEHCz9uVBiBd7Tw_WHcnvZTHOrlVwoY0jxOqAQxKd4hvrQLblsI-0cKOLhooTzCHun4fyWup8H02ksEUH2N8b9UvKT6CeVchDuVWW2W8L_Izai_6NYZQIdhTIXujddFyEvvaWXFj7Z5kUFPQ1KA-2lfHjq3TV37AWa8BKbXkZ8_oT_UtqzI-6l3KyRQJMWRZGmZV3VSddkXZ3VIgkqaGh2UaccrF3UvLnbfoL7u6eNNR_hPMHj6yRwWiCAS2anmzc_qzDM7UraEQOtP2-vDxyy3yADhsr7GTxu8mq9rpOhYWteQyFYxeqig1RU7CgLKIpj3sq8a2WiRQvaNzhG2FkDJxohcI8TlaiGM85TllZplWWsXgmQOEJVeyzXnImMkTUDbKteLTqWQUtcEyW1c-8xqZUP_pFEb6reAEQ6xMcxGKxrnDBCGGunJJI3UfwfSL5HGg">