<div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 25, 2012 at 3:26 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Apr 25, 2012, at 2:57 PM, Richard Smith wrote:<br>
> Our current strategy is that RecursiveASTVisitor attempts to visit template specializations as part of visiting the template from which the specializations are instantiated. This goes wrong for a partial specialization of a member template of a class template:<br>

><br>
>   template<typename T> struct A {<br>
>     template<typename U> struct B;<br>
>   };<br>
><br>
>   template<typename T> template<typename U> struct A<T>::B<U*> {};<br>
><br>
> Here, it's not trivial to find the specializations which are instantiated from the partial specialization, and the RecursiveASTVisitor fails to find them.<br>
><br>
> A somewhat-related problem is that we do not visit template specializations where we have instantiated the declaration but not the definition. In such cases, we do not know (and, from the RecursiveASTVisitor, cannot reasonably compute) which primary template or partial specialization an instantiated declaration should be associated with, so the existing strategy cannot be applied there.<br>

><br>
> I propose that we fix both of these issues by visiting all implicit instantiations of a template (including cases where we have not instantiated a definition) when we visit the primary template; a patch implementing this is attached.<br>

><br>
> This conflicts with the chosen direction from when this functionality was added [1], so I'd like to hear any concerns with this direction.<br>
<br>
</div></div>I have no particular problem with this, but I have never written a RecursiveASTVisitor that wanted to visit instantiations.</blockquote><div><br></div><div>When we want to visit instantiations (and I agree, we often don't hence the bit to keep it disabled by default), we should visit all of them, and the most idomatic way possible. So, LGTM. </div>
</div></div>