Finding uses of functions with a TemplateType argument

David Nolden zwabel at googlemail.com
Mon Oct 19 14:35:13 UTC 2009


Am Montag 19 Oktober 2009 13:03:16 schrieb Bertjan Broeksema:
> Hi All,
> 
> Suppose I have:
> 
> template <class type>
> class MyClass {
>   void blah(const type*);
> };
> 
> Now I want to build a query which finds all uses of "blah(const type*)"
> 
> When I arrive at the function declaration the argument does not seem to
>  have any hint that it actually is an template type. However, when I
The argument-type should be a "KDevelop::DelayedType", which is used only for 
template-dependent not-yet-resolved types, or for unresolved types.

>  evaluate the expression: "const type *" at that context it does seem to
>  have an hint about the fact that it is an template type. I.e. I do:
> 
> argType->toString()         => "const type* d" // From function declaration
> expectedType->toString() => "const <template> type*" // from query
>  description
>
> I expected to have the one comming from the function declaration also
>  having a hint about being a template type. Moreover, I expect:

> argType.indexedType() == expectedType.indexedType()
Not sure why it is not marked properly in that case, maybe it is falsely 
marked as "unresolved" instead of "template"? (Both through 
KDevelop::DelayedType)

> This might be a false assumption of me and another possibility might be to
> iterator over all instantiations of the particular function and find
>  *their* uses.
That should work.

Greetings, David




More information about the KDevelop-devel mailing list