forked from qt-creator/qt-creator
C++: Fix arg. count for functions with function-try-blocks
Task-number: QTCREATORBUG-6343 Change-Id: I71575098c71611dc8514288f7938af4c409ebaa3 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
committed by
Leandro T. C. Melo
parent
2ae1f0cc02
commit
dc23698e3a
7
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
7
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
@@ -308,11 +308,12 @@ bool Function::hasReturnType() const
|
||||
|
||||
unsigned Function::argumentCount() const
|
||||
{
|
||||
const unsigned c = memberCount();
|
||||
unsigned c = memberCount();
|
||||
if (c > 0 && memberAt(0)->type()->isVoidType())
|
||||
return 0;
|
||||
if (c > 0 && memberAt(c - 1)->isBlock())
|
||||
return c - 1;
|
||||
// Definitions with function-try-blocks will have more than a block.
|
||||
while (c > 0 && memberAt(c - 1)->isBlock())
|
||||
--c;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user