[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124430)
[llvm-project.git] / clang / test / Parser / cxx2c-oxford-variadic-comma.cpp
blobb8015b4815b2e2d8dd4de0a82d45e242753d2b26
1 // RUN: %clang_cc1 -std=c++2c -fsyntax-only -fblocks -verify %s
3 void a(...);
5 void b(auto...);
6 void c(auto, ...);
8 void d(auto......); // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}} \
9 // expected-warning {{'...' in this location creates a C-style varargs function}} \
10 // expected-note {{preceding '...' declares a function parameter pack}} \
11 // expected-note {{insert ',' before '...' to silence this warning}}
12 void e(auto..., ...);
14 void f(auto x...); // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}}
15 void g(auto x, ...);
17 void h(auto... x...); // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}} \
18 // expected-warning {{'...' in this location creates a C-style varargs function}} \
19 // expected-note {{preceding '...' declares a function parameter pack}} \
20 // expected-note {{insert ',' before '...' to silence this warning}}
21 void i(auto... x, ...);
23 template<class ...Ts>
24 void j(Ts... t...) {}; // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}} \
25 // expected-warning {{'...' in this location creates a C-style varargs function}} \
26 // expected-note {{preceding '...' declares a function parameter pack}} \
27 // expected-note {{insert ',' before '...' to silence this warning}}
28 template<class ...Ts>
29 void k(Ts... t, ...) {}
31 void l(int...); // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}}
32 void m(int, ...);
34 void n(int x...); // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}}
35 void o(int x, ...);
37 struct S {
38 void p(this S...) {} // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}}
41 template<class ...Ts>
42 void q(Ts......) {} // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}} \
43 // expected-warning {{'...' in this location creates a C-style varargs function}} \
44 // expected-note {{preceding '...' declares a function parameter pack}} \
45 // expected-note {{insert ',' before '...' to silence this warning}}
47 template<class T>
48 void r(T...) {} // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}}
50 auto type_specifier = (void (*)(int...)) nullptr; // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}}
52 auto lambda = [](int...) {}; // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}}
54 auto block = ^(int...){}; // expected-warning {{declaration of a variadic function without a comma before '...' is deprecated}}