diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 30fb1ce2ed9888efce54dc7d086a46f24c34a290..909ae011fe75b4870439ee51ca0fd965882ff114 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -1121,14 +1121,6 @@ bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &ba m_completionOperator, &replacedDotOperator); - if (replacedDotOperator) { - // Replace . with -> - int length = m_editor->position() - m_startPosition + 1; - m_editor->setCurPos(m_startPosition - 1); - m_editor->replace(length, QLatin1String("->")); - ++m_startPosition; - } - QList<Symbol *> classObjectCandidates; foreach (const TypeOfExpression::Result &r, classObjectResults) { FullySpecifiedType ty = r.first.simplified(); @@ -1147,6 +1139,14 @@ bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &ba } } + if (replacedDotOperator && ! classObjectCandidates.isEmpty()) { + // Replace . with -> + int length = m_editor->position() - m_startPosition + 1; + m_editor->setCurPos(m_startPosition - 1); + m_editor->replace(length, QLatin1String("->")); + ++m_startPosition; + } + completeClass(classObjectCandidates, context, /*static lookup = */ false); if (! m_completions.isEmpty()) return true;