This is an archive of the discontinued LLVM Phabricator instance.

[Preprocessor] Implement empty vs omitted __VA_ARGS__ string-expansion MSVC Extension
AbandonedPublic

Authored by erichkeane on Apr 13 2017, 2:01 PM.

Details

Reviewers
rnk
rsmith
Summary

The MSVC compiler extends the preprocessor by emitting an empty VA_ARGS expansion as NOTHING instead of "" (double-double quotes) in the case where the argument is omitted(rather than left empty. For example:
#define M(x,VA_ARGS)
M(5,) Argument is empty, thus this should result in ""
M(5)
Argument is omitted, thus this should result in nothing.

Diff Detail

Event Timeline

erichkeane created this revision.Apr 13 2017, 2:01 PM
erichkeane added a subscriber: cfe-commits.
erichkeane abandoned this revision.Sep 15 2017, 3:11 PM

This has likely gone stale, and my employer has decided to tell customers to modify their code.

I don't know? I don't have a really good way of repro'ing that. Do you have any ability to grab me a preprocessed reproducer of that one? Godbolt doesn't have Windows headers for this.