[cfe-dev] AST::Type::getAs<sugar>()?

Stephan Bergmann sbergman at redhat.com
Thu Apr 16 23:51:29 PDT 2015


I naively assumed AST::Type::getAs<T>() would work regardless whether T 
represents sugar or not, and looking closer it is indeed specialized for 
TypedefType, TemplateSpecializationType, and AttributeType to make those 
work, but not for other sugar like SubstTemplateTypeParmType.

For example, t->getAs<SubstTemplateTypeParmType>() does not work if t is 
a wrapping TypedefType (but happens to work if t itself already is a 
SubsTemplateTypeParmType).  Is that intended?



More information about the cfe-dev mailing list