<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/102589>102589</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Partial specialization failed in clang for template argument not deducible with specialized argument list having template nested class with template enclosing class
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Rush10233
</td>
</tr>
</table>
<pre>
The following code is rejected by clang:
```c++
template <typename T1>
struct outer
{
template <typename T2>
struct inner
{
};
};
struct is_inner_for
{
template <typename Whatever>
struct predicate
{
static constexpr bool value = false;
};
template <typename U>
struct predicate<typename outer<U>::template inner<U>>
{
static constexpr bool value = true;
};
};
```
Note that `typename outer::inner<U>` passes when `outer` is not a template class, while `typename outer<U>::inner<U>` fails. It seems that `U` can always be deduced as long as `inner` is a template class, whether `outer` is templated.
GCC and EDG accept that:
[https://godbolt.org/z/9jTf8zWf8](https://godbolt.org/z/9jTf8zWf8)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE2PozgQ_TXmUprImEDgwKE76Yz2slqtejTHUWGK4JFjI9skm_71K0PnUz3bu1oJBeGqevVelfPQe7UzRDXLn1m-SXAMvXX1n6PvUy6yLGlse6pfe4LOam2PyuxA2pZAeXD0k2SgFpoTSI1mx7InxjeMn38LPj-Sief4vMeqQPtBYyBg2TqcBjK4J3hNWfZySfHBjTKAHQO5yyFbXTF-CSNuYa5IyphbpDuw28MNy26a3H-eofyPCe1HZ_8bt-89BjqQ-5jh4KhVEgP9gmV1zsagJEhrfKC_BgeNtRoOqMfYbAMdak93Ih51fMLy22f0bnLn_WTrqSZ7YtnTBXIe-Dn08v9EBTf-s6b7z_PFu1X8uw0EoccArOCPAiLzO8IFBxjQe_Jw7MnEmjm14PHqGxsA4aJVavSeiTUce6XpowY3E3rs06HSfgG_BfBEe3_h-C0GJRpAfcSTh4agpXaU1AJ60Nbs4psVfAaciX1MikJP7lHDObFd3I7p63oNaFp42XwFlJKGMBF6_Gvnz30Ig4_HYsvEdmfbxuqwsG7HxPaNiW3187Ur3753Jcs3TJT_Pl1Uc4-krbO2yipMqE5XIkurPM-KpK9XsihXqVymEmVXtMuyREGC2lZywi6ViaoFF0te8opXIs-KRZeVnJe5qPKqSku-YktOe1R6ofVhH0kkyvuR6pSLvKwSjQ1pP1miELOzCRHd0dWx4Esz7jxbcq188FeIoIKm-g90QaEGP5BUqNUbBmXNtGRqQZnZKaGz7ropdLtxTyZM12rasWo0wVGF_ooT137Oi52hx0N04wuKIR_NeFr7XHsJkZHa-sm7YzQZna4fFqJCPzYLafdMbKOk99eXwdno8kxspxF5JrbvUzrU4u8AAAD__wUc5BE">