[cfe-dev] [AST] how to check if a type is template specification type and get the template paramter?

Yafei Liu via cfe-dev cfe-dev at lists.llvm.org
Tue Aug 4 04:08:12 PDT 2020

Hi, all.

I want to check if a given `clang::Type` is a std::vector<xxx> and get the
type of xxx.

I tried this `if (const auto *tst =
llvm::dyn_cast<clang::TemplateSpecializationType>(type)) {}` but the
condition is always false, it seems that TemplateSpecializationType is not
what I think it is.

So can what I want be done?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200804/da0d7166/attachment.html>

More information about the cfe-dev mailing list