diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2016-01-22 19:26:44 +0000 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2016-01-22 19:26:44 +0000 |
commit | 34461a626e4fcc72e2facf7dedf8c84cf13e39d2 (patch) | |
tree | 7000fb233aed24e6e36faca36a59a0b00e22d620 /clang/test/Preprocessor/microsoft-ext.c | |
parent | acc43d197d7986f4749eeeb85a4c76caa870d452 (diff) | |
download | bcm5719-llvm-34461a626e4fcc72e2facf7dedf8c84cf13e39d2.tar.gz bcm5719-llvm-34461a626e4fcc72e2facf7dedf8c84cf13e39d2.zip |
[MSVC Compat] Accept elided commas in macro function arguments
Summary:
This fixes PR25875. When the trailing comma in a macro argument list is
elided, we need to treat it similarly to the case where a variadic macro
misses one actual argument.
Reviewers: rnk, rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D15670
llvm-svn: 258530
Diffstat (limited to 'clang/test/Preprocessor/microsoft-ext.c')
-rw-r--r-- | clang/test/Preprocessor/microsoft-ext.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/microsoft-ext.c b/clang/test/Preprocessor/microsoft-ext.c index b03f6775429..cb3cf4f1537 100644 --- a/clang/test/Preprocessor/microsoft-ext.c +++ b/clang/test/Preprocessor/microsoft-ext.c @@ -34,3 +34,12 @@ ACTION_TEMPLATE(InvokeArgument, MAKE_FUNC(MAK, ER, int a, _COMMA, int b); // CHECK: void func(int a , int b) {} + +#define macro(a, b) (a - b) +void function(int a); +#define COMMA_ELIDER(...) \ + macro(x, __VA_ARGS__); \ + function(x, __VA_ARGS__); +COMMA_ELIDER(); +// CHECK: (x - ); +// CHECK: function(x); |