<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99296>99296</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang shouldn't accept extraneous template headers as an extension
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zyn0217
</td>
</tr>
</table>
<pre>
(This is uncovered while working on https://github.com/llvm/llvm-project/pull/75697)
https://github.com/llvm/llvm-project/commit/65911498eff34ac4fc2f9c250efd49aa51c35f85 results in an extension where Clang accepts templates with redundant template headers. However, this is clearly ill-formed and no other compilers would accept it. I think we should probably remove the extension in `Sema::MatchTemplateParametersToScopeSpecifier()` and reject such templates in the end.
https://compiler-explorer.com/z/TcPGjWMGM
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUks9v4yoQx_8afBk1Amzs-OBDXqv0vUOlSo30zhjGgRaDBThu-tevnKS7Xa320IuNNNLM98dHpmSPHrEj4h8iHgo5ZxNi93H2lLOm6IM-d4RvD8YmsAlmr8IJI2pYjHUIS4hv1h8heDA5T4mUO8L3hO-PNpu536gwEr537vT5u5tieEWVCd9Ps3OE7xtRtw3hLaEPhO6u32_vUmEc7fqoRctY1W5xGMpKqmpQfGgVFxQHXbVSCqZKMWwFREyzywmsB-kB3zP6ZIOHxWBEuHfSH0EqhVNOkHGcnMyYYLHZQEQ9ey19_jkAg1JjTBv4Nyx4wkj4PeRbZsqhjO4M1rm7IcQRNUivwQcI2WAEFcbJOowJljA7fbsKNm_gv3WJf4MFIZnLcIqhl707Q8QxnBCywS_irQdS0xcc5RpeuXuSWZnDTeSzjHLEjDEdwosKE75MqOxgV7XbtYCaXoRFXEOFNCvzxbn111teb_7e1KeVO3yfXIgYb6V9EL4_qOfH1_-fHp8K3ZW6LVtZYMcazjhtW8YK04laMklrphWt-bZUuhE4NH3Z8AFpXYrCdpzyijasoa1ggm2krkpGOeuF0I2ualJRHKV1mxWPTYjHwqY0Y9e2vK0LJ3t06UI652ptmJS7IQaf0WvC-cp_7C5k9fMxkYo6m3L6tSzb7LC7snHtwxPe5M_G8D1H6THM6Q8wQKbfMCvm6LpvU34xkwjfX_2cOv4jAAD__356P4U">