Finding uses of functions with a TemplateType argument

Bertjan Broeksema bertjan at kdab.net
Mon Oct 19 11:03:16 UTC 2009


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 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()

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.

Ideas / suggestions?

Cheers,

Bertjan




More information about the KDevelop-devel mailing list