CppEditor: Handle classes that do not override

...when searching the overrides for virtual functions.

In case there is no override for the static type of a function call
expression, make sure to:

1) include the last provided override (look up bases)
2) and all overrides whose classes are derived from that static type

Task-number: QTCREATORBUG-10470

Change-Id: I2c01bfdc6cb35c5a01a000ebd81a2b322ce2b795
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-10-28 15:12:18 +01:00
parent 0c16757085
commit 4a06dab30a
5 changed files with 276 additions and 39 deletions

View File

@@ -48,9 +48,10 @@ public:
VirtualFunctionAssistProvider();
struct Parameters {
Parameters() : function(0), cursorPosition(-1), openInNextSplit(false) {}
Parameters() : function(0), staticClass(0), cursorPosition(-1), openInNextSplit(false) {}
CPlusPlus::Function *function;
CPlusPlus::Class *staticClass;
QSharedPointer<CPlusPlus::TypeOfExpression> typeOfExpression; // Keeps instantiated symbols.
CPlusPlus::Snapshot snapshot;
int cursorPosition;
@@ -80,6 +81,7 @@ public:
static QList<CPlusPlus::Symbol *> overrides(CPlusPlus::Function *function,
CPlusPlus::Class *functionsClass,
CPlusPlus::Class *staticClass,
const CPlusPlus::Snapshot &snapshot);
};