Fix argument count for functions with void argument.

This fixes highlighting calls to these functions.

Merge-request: 219
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
This commit is contained in:
Francois Ferrand
2010-11-16 12:58:30 +01:00
committed by Erik Verbruggen
parent 4943d19907
commit 9c0eacf800

View File

@@ -287,6 +287,8 @@ bool Function::hasReturnType() const
unsigned Function::argumentCount() const
{
const unsigned c = memberCount();
if (c > 0 && memberAt(0)->type()->isVoidType())
return 0;
if (c > 0 && memberAt(c - 1)->isBlock())
return c - 1;
return c;