File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1457,11 +1457,15 @@ class Macro {
14571457 Token *B = tok->next ->next ;
14581458 std::string strAB;
14591459
1460+ const bool varargs = variadic && args.size () >= 1U && B->str == args[args.size ()-1U ];
1461+
14601462 TokenList tokensB (files);
14611463 if (expandArg (&tokensB, B, parametertokens)) {
14621464 if (tokensB.empty ())
14631465 strAB = A->str ;
1464- else {
1466+ else if (varargs && A->op == ' ,' ) {
1467+ strAB = " ," ;
1468+ } else {
14651469 strAB = A->str + tokensB.cfront ()->str ;
14661470 tokensB.deleteToken (tokensB.front ());
14671471 }
@@ -1470,7 +1474,7 @@ class Macro {
14701474 }
14711475
14721476 bool removeComma = false ;
1473- if (variadic && strAB == " , " && tok->previous ->str == " ," && args. size () >= 1U && B-> str == args[args. size ()- 1U ] )
1477+ if (varargs && tokensB. empty () && tok->previous ->str == " ," )
14741478 removeComma = true ;
14751479
14761480 output->deleteToken (A);
You can’t perform that action at this time.
0 commit comments