<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hi Richard,</div><div><br></div><div>Thank you for your reply. Yes, the case I need to deal with is like what you said:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">If you want to make the assumption that the primary template will be<br>
used for an unknown specialization, you'll need something like that<br>
function in ASTMatchFinder.</blockquote><div><br></div><div>For example,</div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><ol><li> template <typename T> <br></li><li> struct Base {}; <br></li><li> template <typename T><br></li><li> struct Derived : Base<T>{}; <br></li><li><br></li><li> Derived<int> T1;</li></ol></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div>In this case, I need to firstly get the CXXBaseSpecifier from line 4, then get the QualType of primary template (Base<T>), then get its declaration. For this case, that function in ASTMatchFinder works but Type::getAsCXXRecordDecl does not. </div><div><br></div><div>So, what do you suggest?</div><div><br></div><div>Best regards,</div><div>Cong</div></div></div></div>