1

Given the following code to parse:

template <typename T, int N=3>
class Base {};

using BaseFloat1 = Base<float, 1>;

I can get the TypeAliasDecl from the last line, get the CXType from that, and the use clang_Type_getNumTemplateArguments() to see that there are two template arguments there, but the only option for retrieving the arguments is clang_Type_getTemplateArgumentAsType(), which obviously fails for the second, IntegerLiteral argument.

Is there any way to get the non-type template argument directly, other than inspecting the children of the TypeAliasDecl cursor?

user1832047
  • 155
  • 9

0 Answers0