<div dir="ltr"><div>I have an AST matcher that is matching calls to a variadic function.  The types of the expressions are really confusing me, though.</div><div><br></div><div>The call expression that is matched is:</div><div>log.Log<DebugLevel::error>("Some string", static_cast<const MyType>(5))</div><div><br></div><div>The argument expression that is matched is:</div><div>static_cast<const MyType>(5)</div><div><br></div><div>MyType is a typedef.  Depending on what MyType is I get odd results.</div><div><br></div><div>If MyType is int, then I get callExpr->getArg(1)->getType().getAsString() is "MyType", and callExpr->getArg(1)->getType().getCanonicalType().getAsString() is "int".  I will express this as "int->MyType->int".</div><div><br></div><div>So, what I am getting is:</div><div>int->MyType->int</div><div>bool->int->int</div><div>float->double->double</div><div>char->int->int</div><div><br></div><div>It makes sense to me that int->MyType->int occurs.  Could someone explain what I am missing, why I get these results, and how to get what I would expect (X->MyType->X)?</div></div>