diff clang/test/Preprocessor/empty_va_arg.cpp @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/clang/test/Preprocessor/empty_va_arg.cpp	Wed Nov 09 17:45:10 2022 +0900
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -Eonly -std=c++17 -pedantic -verify %s
+// RUN: %clang_cc1 -Eonly -std=c17 -pedantic -verify -x c %s
+// RUN: %clang_cc1 -Eonly -std=c++20 -pedantic -Wpre-c++20-compat -verify=compat %s
+
+#define FOO(x, ...) // expected-note {{macro 'FOO' defined here}} \
+                    // compat-note {{macro 'FOO' defined here}}
+
+int main() {
+  FOO(42) // expected-warning {{must specify at least one argument for '...' parameter of variadic macro}} \
+          // compat-warning {{passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20}}
+}
+