xref: /llvm-project/clang/test/Preprocessor/empty_va_arg.cpp (revision 5231005193afb8db01afe9a8a1aa308d25f60ba1)
1 // RUN: %clang_cc1 -Eonly -std=c17 -pedantic -verify=c17,expected -x c %s
2 // RUN: %clang_cc1 -Eonly -std=c23 -pedantic -Wpre-c23-compat -verify=c23,expected -x c %s
3 // RUN: %clang_cc1 -Eonly -std=c++17 -pedantic -verify=cxx17,expected %s
4 // RUN: %clang_cc1 -Eonly -std=c++20 -pedantic -Wpre-c++20-compat -verify=cxx20,expected %s
5 
6 // silent-no-diagnostics
7 
8 #define FOO(x, ...) // expected-note  {{macro 'FOO' defined here}}
9 
main()10 int main() {
11   FOO(42) // c17-warning {{passing no argument for the '...' parameter of a variadic macro is a C23 extension}} \
12           // cxx17-warning {{passing no argument for the '...' parameter of a variadic macro is a C++20 extension}} \
13           // c23-warning {{passing no argument for the '...' parameter of a variadic macro is incompatible with C standards before C23}} \
14           // cxx20-warning {{passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20}}
15 }
16 
17