summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/microsoft-ext.c
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2016-01-22 19:26:44 +0000
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2016-01-22 19:26:44 +0000
commit34461a626e4fcc72e2facf7dedf8c84cf13e39d2 (patch)
tree7000fb233aed24e6e36faca36a59a0b00e22d620 /clang/test/Preprocessor/microsoft-ext.c
parentacc43d197d7986f4749eeeb85a4c76caa870d452 (diff)
downloadbcm5719-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.c9
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);
OpenPOWER on IntegriCloud