Files
qt-creator/src/plugins/cpptools/symbolfinder.cpp
Christian Kandeler 414561e4cc CppTools: More consistent fuzzy matching behavior
There were annoying inconsistencies, for instance:
    - A not fully matching declaration was found from the definition,
      but not vice versa.
    - An implementation MyClass::foo(int) would fall back to a
      declaration foo(), but an implementation MyClass::foo() would
      not fall back to a declaration foo(int).
These cases behave consistently now. To this end, the clang code model
now forwards to the built-in code model if a function lookup has failed.

Fuzzy matching for free functions has been limited, as the cons appear
to outweigh the pros. For instance:
    void foo(int);
    void foo(double) {}
Following the definition would lead to the non-matching declaration,
which the user most likely does not want.

As a side effect, redundant code has been removed in the SymbolFinder
class.

Fixes: QTCREATORBUG-20279
Change-Id: Ib97d6710c7e12fb0fdbc30b51a0067e09bfc2190
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-14 13:21:36 +00:00

17 KiB