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

    <tr>
        <th>Summary</th>
        <td>
            [clang] assertion when matching TTP with templates of different class types
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            crash-on-valid
      </td>
    </tr>

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

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

<pre>
    Repro: https://godbolt.org/z/nj4e3ezxW

```C++
struct X {};
struct Y {
  constexpr Y(const X &) {}
};

template<template<X> class> struct A {};
template<Y> struct B;
template struct A<B>;
```

We are creating the injected NTTP with wrong value kind, it should be an lvalue instead of prvalue.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkUk1vozAQ_TXDZZQIhhDCgUM-ynG1WlVqezR4ALeOjWyTtvn1K0jSZruSZcyz5-u9J7xXnWEuIdsB0VGdT_xmT0AE2SESY-itK29oVFv5Wf7hwVlIt9iHMHhIt0AVUNVZWVsdltZ1QNUZqDKvK075_PEE8QHi7XVfx5e1B9pNa0Z9cGMT8Bkh30F-gPRf_GXGZwSxscYH_hgcvgBt5r8pkNZAxS3-Uuou0WUPfBy0CAzp_u74DOkDNlp4Px2uJbc_W7kLeLl7t_vvwVcGSPc7SB--e7iNft_SE6NwjI1jEZTpMPSMyrxyE1jir8fH3_iuQo_vzpoOT0KPjG_KSKA9qoC-t6OWWDMKg_pyrSZ6hETb4uBmaBnJMpVFWoiIyyQnWmVZluRRX1JcyGITxzJfZ9xskmS9aTiJN3HRUFu3baRKimkV52mSFFmSrZdEVMiCqN0UWZJQDquYj0Lppdan4yR-pLwfuUziJC1WkRY1a391V6OF6SDdts6awNMQBLSfLpzw_cKaxUloJa_mc-WUclGPnYdVrJUP_rtIUEHPpr3kzA4ovGcXlDX43rPBowhNPxH6ReFNHz8xI1XbsmMTLsJj-BzYR6PT5Q9Xq9CP9bKxR6Bqqn79LAZnJ5GAqnleD1RdRz6V9DcAAP__ChMF3g">