Inconsistent behaviour of AliasDeclarations + DUContext::localDeclarations()?

David Nolden david.nolden.kdevelop at art-master.de
Sun Apr 15 15:12:22 UTC 2012


I guess you mean findLocalDeclarations, as only that does this.

However, findDeclarations calls findLocalDeclarations, so that
basically the whole searching stack relies on this.

It is possible that this is not required any more, however I'd prefer
not touching this, as this is the very foundation of the language
support.

If you don't want this filtering, you can simply add one or multiple
search flags (see DUContext::SearchFlags) to manipulate this.

Regarding the range-check: This is not related to alias-declarations
at all. This simply models that in C++ you cannot reference
declarations before they are declared, therefore it checks whether the
found declaration is declared before the current position. The C++
specific part here is that it works in classes, but not on the global
scope. This actually might be the same in python. Otherwise, you can
also disable this check using a SearchFlag.

Greetings, David




More information about the KDevelop-devel mailing list