[PATCH] libclang: New functions clang_Type_getNumTemplateArguments, clang_Type_getTemplateArgument.

Dmitri Gribenko gribozavr at gmail.com
Thu Feb 27 06:37:47 PST 2014


  I have just checked and indeed, they are represented as Packs.

  Doing something simple like flattening the list would not be correct.

  How about this:

  * rename clang_Type_getTemplateArgument to clang_Type_getTemplateArgumentAsType,
  * keep its current behaviour, checked with a test,
  * add a note in the API documentation that this function does not allow one to look inside parameter packs.

  This allows one to look at type arguments, and allows future extensibility by introducing ...getTemplateArgumentKind(), ...getTemplateArgumentAsPack(), ...AsInteger(), if we need to do so.

http://llvm-reviews.chandlerc.com/D1688



More information about the cfe-commits mailing list