[cfe-dev] abort calling getTypeSize

Dmitri Gribenko gribozavr at gmail.com
Mon Feb 25 10:45:10 PST 2013


On Mon, Feb 25, 2013 at 8:32 PM, Peeter Joot <peeter.joot at gmail.com> wrote:
> I found getInstantiatedFromMemberClass() in the docs, and it appears I can
> use this to see if the template is an instantiation.

It will not handle all cases, just what it says -- only for member
classes.  Try CXXRecordDecl::getMemberSpecializationInfo().

> I don't see a isTemplateClass() or anything like that?  How would such a
> check be done?

Try CXXRecordDecl::getDescribedClassTemplate() -- it will return a
corresponding ClassTemplateDecl given a CXXRecordDecl for 'A' in:
template<typename T> struct A {};

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-dev mailing list