Partial fix for #1475 (False positive: Not enough parameters for macro: #define A(a, b...))
http://sourceforge.net/apps/trac/cppcheck/ticket/1475
This commit is contained in:
parent
2eceaaefc0
commit
0cc84bd2be
|
@ -1598,7 +1598,9 @@ public:
|
|||
{
|
||||
if (str == _params[i])
|
||||
{
|
||||
if (_variadic && i == _params.size() - 1)
|
||||
if (_variadic &&
|
||||
(i == _params.size() - 1 ||
|
||||
(params2.size() + 2 == _params.size() && i + 1 == _params.size() - 1)))
|
||||
{
|
||||
str = "";
|
||||
for (unsigned int j = (unsigned int)_params.size() - 1; j < params2.size(); ++j)
|
||||
|
|
|
@ -1300,8 +1300,7 @@ private:
|
|||
"ABC(2,3);\n"
|
||||
"ABC(4,5,6);\n";
|
||||
|
||||
// When this TODO assertion works, #1475 is probably fixed
|
||||
TODO_ASSERT_EQUALS("\n\n\n1 + 0 * 0\n2 + 03 * 0\n4 + 05 * 06\n", OurPreprocessor::expandMacros(filedata));
|
||||
ASSERT_EQUALS("\n\n\n1+0*0;\n2+03*0;\n4+05*06;\n", OurPreprocessor::expandMacros(filedata));
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue