Hi,<div><br></div><div><div class="gmail_quote">On Sun, May 27, 2012 at 6:29 PM, Yang Chen <span dir="ltr"><<a href="mailto:chenyang@cs.utah.edu" target="_blank">chenyang@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Seems RecursiveASTVisitor has a bug which could cause duplicated visits to default arguments for a class template. For example, given the code below:<br>
<br>
class X;<br>
template<class T = X> class Y;<br>
template<class T> class Y {};<br>
<br>
The default argument 'X' will be visited twice. The attached patch fixed the problem.</blockquote><div><br></div><div>Thanks, the patch looks good. We should also handle NonTypeTemplateParmDecl in the same way.<br>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I also attached a small testcase. Thanks.</blockquote><div><br></div><div>(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).</div>
</div></div>