Hi,

On Sun, May 27, 2012 at 6:29 PM, Yang Chen <[email protected]> wrote:

> Seems RecursiveASTVisitor has a bug which could cause duplicated visits to
> default arguments for a class template. For example, given the code below:
>
> class X;
> template<class T = X> class Y;
> template<class T> class Y {};
>
> The default argument 'X' will be visited twice. The attached patch fixed
> the problem.


Thanks, the patch looks good. We should also handle NonTypeTemplateParmDecl
in the same way.


> I also attached a small testcase. Thanks.


(It's conventional to put the code and test changes in the same patch
file.) Tests for the other two flavours of template parameters would be
great (you will probably need to add new ExpectedLocationVisitor subclasses
to RecursiveASTVisitorTest to test those).
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to