New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variadic macros failing to expand if trailing ... is empty (Origin: bugzilla #731985) #5506

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.8.6 on platform Other
Assigned to: Dimitri van Heesch

On 2014-06-20 19:46:36 +0000, rorzik wrote:

With MACRO_EXPANSION=yes, in the following simplified example, the entries for VAR_MACRO1 expand, while the first entry for VAR_MACRO2 does not. The C++ preprocessor considers all of them correct syntax, so the expected result is that each macro would expand. (Thanks for taking a look.)

/// \file simpletest.h

#define VAR_MACRO1(...) void DemoFunction1(VA_ARGS) { }

VAR_MACRO1();
VAR_MACRO1(int x);
VAR_MACRO1(int x, float y);

#define VAR_MACRO2(T, ...) T DemoFunction2(VA_ARGS) { }

VAR_MACRO2(void);
VAR_MACRO2(void, int x);
VAR_MACRO2(void, int x, float y);

////////////////////

The documentation generated looks like:

void DemoFunction1 ()
void DemoFunction1 (int x)
void DemoFunction1 (int x, float y)
VAR_MACRO2 (void)
void DemoFunction2 (int x)
void DemoFunction2 (int x, float y)

On 2014-06-24 19:10:34 +0000, Dimitri van Heesch wrote:

Confirmed. Should be fixed in the next GIT update.

On 2014-08-21 17:15:31 +0000, Dimitri van Heesch wrote:

This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.8. Please verify if this is indeed the case. Reopen the
bug if you think it is not fixed and please include any additional information
that you think can be relevant (preferrably in the form of a self-contained example).

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment