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

    <tr>
        <th>Summary</th>
        <td>
            [clang][rejects-valid] not finding partial specialization of nested class template
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    the following valid code does not compile on any version of clang i have tested, including trunk:

```c++

template <class I>
struct Outer
{
  template <I X, I Y>
  struct Inner;
};

Outer<int> e2; // <== need to instantiate the outer template here

template <class I> 
template <I Y>
struct Outer<I>::Inner<0, Y> {};

constexpr Outer<int>::Inner<0, 4> e{}; // <== type incomplete here
```

the error is:

```
<source>:15:35: error: constexpr variable cannot have non-literal type 'const Outer<int>::Inner<0, 4>'
constexpr Outer<int>::Inner<0, 4> e{};
 ^
<source>:15:35: error: implicit instantiation of undefined template 'Outer<int>::Inner<0, 4>'
<source>:6:10: note: template is declared here
 struct Inner;
         ^
2 errors generated.
Compiler returned: 1
```

demo:
https://godbolt.org/z/8rvKqqWhM

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVE1v4zYQ_TWjyyAGRVqWfdDBHzEQFEWP7R5pcmyxpUgtSbnN_vqClONkk0WRYg3CImy9efM4j0_GaC6OqINmB82hklPqfegoGOUMnSyF6uT1c5d6wrO31v9t3AWv0hqNymtC7Smi8wmVH0ZjCb1D6Z7xSiEa79CfUVnpLmiwl1fCRDGRBr5H45SddC6XwuT-ArEFVtaKzUsB3-VVfk00jFYmQhB7ZWWM-ATiEdg2pjCphL9NiUJ-tc0AxLfvP-EfmfAJv8wQxBvoyTkKIApFe7ht2HauJfbGJRCPSBzEDoEfgR9zORAHEAd0RBqTR-Niki6ZTJaPyWf0K39Pgf5LAr77597ld8LEvsgVWxDbW9d7lkV9KSXa3dv-lXcx0T9jwO-V_AC-LALv-I8q0_NIeVR-GC29kfMypJu0npBC8AFN_DjIvBf76KegaG6jbkBsRf6aYXnz2vVVBiNPllBJl61VjOO8e7AmUZB2bgp4WyCfEwm8_amTybaB5vFzUswwWqNMeuON212YnKazcdk595nz9n8oeMe-yh2wzOl8ovy81zURNSkrA-mXqf3A9_jymcXxWUTECzkKMpFeANvu57sdMFCagiOdieqPNtA0-Hn8fUpjcULx08Xrk7dp4cMF-PEb8OM6XH_5-vX3_ldg20p3Qm_ERlbU1e2y5ut2s2JV35Ha1Hq53KzYRixJtrJl4szq9eZ85mtSVJmOM94wwVb1hq0YW6x5rU_tuV41S8XWTMKS0SCNXVh7HTJ9ZWKcqKsFq1essvJENpbs47zEFHCeYzB0GfBwmi4RlsyamOJriWSSLYE5I5oDNLtAf5JK8aEkIzSHEoln40q-jTIkIy3GkZSR1ny728GVNMQ5DV4mV03Bdu8O0KR-Oi2UH4AfcyO3x8MYfCYGfizCIvDjTdu14_8GAAD__8xHyO4">