Fixes: Possible crash when completing a function with (void) argument.

This commit is contained in:
Roberto Raggi
2009-02-09 20:34:54 +01:00
parent 0504fdd00b
commit d018cfd5cb

View File

@@ -1113,7 +1113,8 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
toInsert.append(QLatin1Char('('));
// If the function takes no arguments, automatically place the closing parenthesis
if (function->argumentCount() == 0 || (function->argumentCount() == 1 &&
if (function->argumentCount() == 0 || (function->argumentCount() == 1 &&
function->argumentAt(0)->type() &&
function->argumentAt(0)->type()->isVoidType())) {
toInsert.append(QLatin1Char(')'));