[cfe-commits] [PATCH] Suppress elided variadic macro argument diagnostic with comma pasting extension
Richard Smith
richard at metafoo.co.uk
Mon Nov 12 17:34:06 PST 2012
On Mon, Nov 12, 2012 at 4:38 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Mon, Nov 12, 2012 at 3:49 PM, Richard Smith <richard at metafoo.co.uk> wrote:
>> As an alternative, could we disable the comma-pasting diagnostic for a
>> macro with any parameters?
>
> If I'm following what you're asking correctly, the standard requires
> us to diagnose the following:
>
> #define A(a, ...) f(a, ## __VA_ARGS__)
> void f(int,int,int);
> void g() {
> A(1,2,3);
> }
>
> because without the comma pasting extension, we would try to form a token ",2".
Sorry, I meant to say, disable the comma-pasting diagnostic for a
macro with any parameters, where no arguments have been provided for
the ellipsis (that is, in exactly those cases where we will have
already produced the 'no arguments provided for ellipsis' diagnostic).
More information about the cfe-commits
mailing list