OSDN Git Service

Fix argument count for functions with void argument.
authorFrancois Ferrand <thetypz@gmail.com>
Tue, 16 Nov 2010 11:58:30 +0000 (12:58 +0100)
committerErik Verbruggen <erik.verbruggen@nokia.com>
Thu, 18 Nov 2010 12:51:18 +0000 (13:51 +0100)
This fixes highlighting calls to these functions.

Merge-request: 219
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
src/shared/cplusplus/Symbols.cpp

index dd39b06..0bb231e 100644 (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;