Skip to content
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

[cpp.subst]/4 Isn't the macro execution example wrong? #4317

Closed
onihusube opened this issue Nov 7, 2020 · 2 comments
Closed

[cpp.subst]/4 Isn't the macro execution example wrong? #4317

onihusube opened this issue Nov 7, 2020 · 2 comments

Comments

@onihusube
Copy link
Contributor

Here is an example of H3.

#define H3(X, ...) #__VA_OPT__(X##X X##X)
H3(, 0)             // replaced by ""

On the other hand, just below that is:

Each # preprocessing token in the replacement list for a function-like macro shall be followed by a parameter as the next preprocessing token in the replacement list.

This is inconsistent and I think the code example is wrong, but what about?

When I run it, it seems to reject everything except clang.

@jensmaurer jensmaurer changed the title [cpp.subset]/4 Isn't the macro execution example wrong? [cpp.subst]/4 Isn't the macro execution example wrong? Nov 7, 2020
@jensmaurer
Copy link
Member

[cpp.subst] p4

A va-opt-replacement is treated as if it were a parameter...

@onihusube
Copy link
Contributor Author

I overlooked it, thank you...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants