Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Index reference lookup omits definitions with qualified name?


Consider such C++ code:

class K {
    void foo();

void K::foo() {


I retreived a CPPASTQualifiedName "K::foo" directly from the AST and ran an index lookup for declarations and definitions on it:

IBinding binding = name.resolveBinding();
IIndexName[] declarations = index.findNames(binding,IIndex.FIND_DECLARATIONS_DEFINITIONS);

For some reason I only receive one result after the lookup, pointing to the declaration in the class signature. The definition below gets omitted.
The same situation happens for functions inside namespaces.

Note that If the function definition doesn't have a qualified name, then everything works fine and after lookup of the following code, the same index lookup finds both the declaration and the definition.

void foo();
void foo() {

Am I doing the lookup incorrectly or is it a bug?

Best regards,
-- Tomasz Wesołowski

Back to the top