<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/96718>96718</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang/AST/TemplateName.h: Comment on TemplateName ends abruptly: "... can only be understood in the context of"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
smcpeak
</td>
</tr>
</table>
<pre>
In [`clang/AST/TemplateName.h`](https://github.com/llvm/llvm-project/blob/llvmorg-18.1.8/clang/include/clang/AST/TemplateName.h#L201), there is this comment on `TemplateName` that ends abruptly:
```cpp
/// Some template names are dependent. For example, consider:
///
/// \code
/// template<typename MetaFun, typename T1, typename T2> struct apply2 {
/// typedef typename MetaFun::template apply<T1, T2>::type type;
/// };
/// \endcode
///
/// Here, "apply" is treated as a template name within the typename
/// specifier in the typedef. "apply" is a nested template, and can
/// only be understood in the context of
class TemplateName {
```
That is consequently also in the doxygen documentation for [`TemplateName`](https://clang.llvm.org/doxygen/classclang_1_1TemplateName.html#details).
The comment has been that way since it was first added in 2009 in commit dc572a326610e.
I'm not sure how this thought was meant to be completed. I might suggest something like:
* "apply" is a nested template, and can only be understood in the context of a template instantiation, hence is represented as a dependent template name.
This isn't particularly important, of course, but as it led me down a bit of a rabbit hole trying to figure out why there was a sentence fragment there (I initially assumed a botched merge was responsible), it might do the same for others. Ideally it would be repaired, but removal would also be better (IMO) than leaving it incomplete.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVk2P4jgT_jXmUpoocSCQQw499IvelnZ2D9P3kWMXiXccO2tXmsm_X9kEGpjWakZChPjjeerjqSpECLqziA3bfGab55WYqHe-CYMcUXxftU7NzYuFuFvl0gjbMX54-vrK-OEVh9EIwj_FgFnPqpxtnhnf9URjYOUT4wfGD52mfmoz6QbGD8a8XR6fRu_-RkmMH1rj2mXV-e5TscuKbMf44cKmrTST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