[cfe-users] two copies of class with dependent base - one is "unusable"

Zac Hansen via cfe-users cfe-users at lists.llvm.org
Wed Jul 20 00:49:10 PDT 2016


if I have something like

template<class T>
class V8TOOLKIT_WRAPPED_CLASS
MyTemplate {};

template<class T>
class V8TOOLKIT_WRAPPED_CLASS DerivedFromMyTemplate : public MyTemplate<T> {};

and then DerivedFromMyTemplate<int> some_var;

I get two CXXRecordDecl's from my matcher which just matches all classes
and structs -- one with a base of

 MyTemplate<T>


and it has no associated cxxrecorddecl or tagdecl.   It has typeclass 32
(which I don't know what means).


Then I get another one with with a base of:  MyTemplate<int> (notice <T> vs
<int>).   This one also has typeclass 32 but does have a cxxrecorddel and
tagdecl.

If I instantiate another type, DerivedFromMyTemplate<short> some_other_var;


I do not get another "bad" type, I just get 3 - bad, int, short.

I've gotten what I need by simply skipping the "bad" one but I'd like to
know what's going on.


Thank you.


--Zac
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20160720/5c4ad1bb/attachment.html>


More information about the cfe-users mailing list