Commit f746c746 authored by Christian Kamm's avatar Christian Kamm Committed by Leandro T. C. Melo
Browse files

C++: Improve calculation of function argument count.



Reuse Function::argumentCount instead of reimplementing it.

Change-Id: I05ba2dbee087e5dfd53c7af3ec94d214f6e37a54
Reviewed-by: default avatarLeandro T. C. Melo <leandro.melo@nokia.com>
parent dc23698e
......@@ -378,9 +378,9 @@ void FunctionDeclDefLink::showMarker(CPPEditorWidget *editor)
// does consider foo(void) to have one argument
static int declaredArgumentCount(Function *function)
{
int c = function->memberCount();
if (c > 0 && function->memberAt(c - 1)->isBlock())
return c - 1;
int c = function->argumentCount();
if (c == 0 && function->memberCount() > 0 && function->memberAt(0)->type().type()->isVoidType())
return 1;
return c;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment