forked from qt-creator/qt-creator
CppEditor: Find implementations for pure virtual declaration
Clearly, if a user presses F2 on the declaration of an (unimplemented) pure virtual function, they want to go to an implementation in a derived class. Fixes: QTCREATORBUG-10160 Change-Id: Ie8c4ff0001ab2c98a2d0e2ebc8d954cc928578c0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -111,8 +111,17 @@ VirtualFunctionHelper::VirtualFunctionHelper(TypeOfExpression &typeOfExpression,
|
||||
bool VirtualFunctionHelper::canLookupVirtualFunctionOverrides(Function *function)
|
||||
{
|
||||
m_function = function;
|
||||
if (!m_function || !m_baseExpressionAST || !m_expressionDocument || !m_document || !m_scope
|
||||
|| m_scope->isClass() || m_scope->isFunction() || m_snapshot.isEmpty()) {
|
||||
|
||||
if (!m_document || m_snapshot.isEmpty() || !m_function || !m_scope)
|
||||
return false;
|
||||
|
||||
if (m_scope->isClass() && m_function->isPureVirtual()) {
|
||||
m_staticClassOfFunctionCallExpression = m_scope->asClass();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!m_baseExpressionAST || !m_expressionDocument
|
||||
|| m_scope->isClass() || m_scope->isFunction()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user