Skip to content
Snippets Groups Projects
Commit d018cfd5 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

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

parent 0504fdd0
No related branches found
No related tags found
No related merge requests found
......@@ -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(')'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment