[cfe-commits] Fix for RecursiveASTMatcher not traversing nested template instatiations

Richard Smith richard at metafoo.co.uk
Tue Apr 24 13:46:20 PDT 2012


On Tue, Apr 24, 2012 at 1:39 PM, Chandler Carruth <chandlerc at google.com>wrote:

> On Tue, Apr 24, 2012 at 1:32 PM, Richard Smith <richard at metafoo.co.uk>wrote:
>
>> RecursiveASTVisitor::TraverseClassInstantiations completely ignores
>> templates for which we have instantiated the declaration but not the
>> definition, so your patch does not introduce the problem I was concerned
>> about. So: LGTM.
>>
>> Separately from that, we have the question of whether we should be
>> visiting such declarations. I think we probably should.
>>
>
> Yes, we absolutely should.
>
> I don't understand why, if this is fixed, the original patch would still
> be required? I may be missing something though, i've not studied this in
> depth.
>

The tests added by the original patch are valuable, and it brings us to a
consistent (if not ideal) state -- we should (assuming no other lurking
bugs) now visit all instantiations which are defined and none which are
just declared. I see this fix as being of higher priority than ensuring
that we visit such declarations. I've checked this in as r155487 for those
reasons.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120424/0da14f2e/attachment.html>


More information about the cfe-commits mailing list