diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 635bf9e7b01086bfb7715624d1131179e00ff2e9..935e031595973b0a3686d5752e26dc2f51a250ff 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -634,8 +634,10 @@ int CppCodeCompletion::startPosition() const bool CppCodeCompletion::triggersCompletion(TextEditor::ITextEditable *editor) { const int pos = editor->position(); - if (startOfOperator(editor, pos, /*token =*/ 0, /*want function call=*/ true) != pos) { - if (m_completionOperator == T_POUND) { + unsigned token = T_EOF_SYMBOL; + + if (startOfOperator(editor, pos, &token, /*want function call=*/ true) != pos) { + if (token == T_POUND) { if (TextEditor::BaseTextEditor *edit = qobject_cast<TextEditor::BaseTextEditor *>(editor->widget())) { QTextCursor tc(edit->document()); tc.setPosition(pos);