From 070c35549da108695074239be3ab4268f3722261 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 24 Jun 2014 21:09:27 +0200 Subject: [PATCH] Bug 731985 - Variadic macros failing to expand if trailing ... is empty --- src/pre.l | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pre.l b/src/pre.l index 6d818f35bc4..f06cc984883 100644 --- a/src/pre.l +++ b/src/pre.l @@ -886,8 +886,9 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int } // PHASE 2: apply the macro function - if (argCount==def->nargs || - (argCount>def->nargs && def->varArgs)) // matching parameters lists + if (argCount==def->nargs || // same number of arguments + (argCount>=def->nargs-1 && def->varArgs)) // variadic macro with at least as many + // params as the non-variadic part (see bug731985) { uint k=0; // substitution of all formal arguments