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

    <tr>
        <th>Summary</th>
        <td>
            Out-of-class definition of member of constrained specialization
        </td>
    </tr>

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

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

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

<pre>
    ```c++
template<class T> concept C1 = true;
template<class T> concept C2 = C1<T> && true;

template<C1> struct X { };
template<C2 T> struct X<T> { struct Y; };

template<C2 T> struct X<T>::Y { }; // (1)
```

Clang rejects (1) saying:

```
<source>:7:10: error: type constraint differs in template redeclaration
template<C2 T> struct X<T>::Y { };
         ^
<source>:4:10: note: previous template declaration is here
template<C1 T> struct X { };
         ^
<source>:7:29: error: no struct named 'Y' in 'X<T>'
template<C2 T> struct X<T>::Y { };
                      ~~~~~~^
```

This is wrong, `Y` is a member of the partial specialization on line 5, not the primary template on line 4.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVE1zmzAQ_TXiookHiS_7wCGx3WsvOdRHAYtRKiRGEsm4v74rCA5OfUg7ZVaWYHffPr2VXJnmUpI8nq0m_ClYfCDxo4d-UMIDSfa1Es7RZ5IcaW10DYOne0ZJcqDejhjwtQw-ZewZuicH4TnaLcQfQCH8SB0G1Z7-oKR4wnG4VxLxn9ex1zKY8v7thHk36V8FIckj2mlVHtl_Q8NpywjfvcMtQq7R90roM7XwArV3Szx14iL1OeCuQj_nJ3tnRlvDzKDAwWL8oWCtsWHhLwMEgZGukNrTRrYtWEelpsumsHID2A4rvDT63zc8Z9LlIdnxLsn0SlKbUOCRDhZepRndB6MVHyod7cDCnb7f8vp7JkEubMxaLm0WPC16aLAZxQlHkAun69558d9kunlIcfxsV-73Ts5zh-qgvVmDR4XvKfpPOMI3QXvoK7DUtNR3QAdhvRSKugFqnOWvWV40JTXQLKRjR-ZYK3thLx8NWaLSTQQly_N0G2fpLo-aMml2yU5EXnoF5ffRP5j2Yb7bDbRSy7lIuyJzPY2o7y2ZaLSq7LwfXJBtuj5n6bux2tSmxxelXpfpYbAm3Bd8lc6N4HCRbRlPo67cpUW-Tbe7HNptyxhUkGRtnXOWFrzI2yRSogLlSpLhfxnX8EYnCFyT7BDJksecszhOWIKI-SZJ4zpnOcviJi6aqiJpDL2QahN4bIw9R7acKFXj2aFTSefdhxOlkGcNMJVDfDH6ztjy5U38BHWJptLlRP03gfOPYw">