1 // RUN: %clang_cc1 %s -Eonly -verify -Wno-all -pedantic -std=c++2a
3 //expected-error@+1{{missing '('}}
4 #define V1(...) __VA_OPT__
7 #define V1(...) __VA_OPT__ ()
10 //expected-warning@+1{{can only appear in the expansion of a variadic macro}}
11 #define V2() __VA_OPT__(x)
14 //expected-error@+2{{missing ')' after}}
15 //expected-note@+1{{to match this '('}}
16 #define V3(...) __VA_OPT__(
19 #define V4(...) __VA_OPT__(__VA_ARGS__)
22 //expected-error@+1{{nested}}
23 #define V5(...) __VA_OPT__(__VA_OPT__())
26 //expected-error@+1{{not followed by}}
27 #define V1(...) __VA_OPT__ (#)
30 //expected-error@+1{{cannot appear at start}}
31 #define V1(...) __VA_OPT__ (##)
34 //expected-error@+1{{cannot appear at start}}
35 #define V1(...) __VA_OPT__ (## X) x
38 //expected-error@+1{{cannot appear at end}}
39 #define V1(...) y __VA_OPT__ (X ##)
43 #define FOO(x,...) # __VA_OPT__(x) #x #__VA_OPT__(__VA_ARGS__) //OK
45 //expected-error@+1{{not followed by a macro parameter}}
46 #define V1(...) __VA_OPT__(#)
49 //expected-error@+1{{cannot appear at start}}
50 #define V1(...) a __VA_OPT__(##) b
53 //expected-error@+1{{cannot appear at start}}
54 #define V1(...) a __VA_OPT__(a ## b) b __VA_OPT__(##)
57 #define V1(x,...) # __VA_OPT__(b x) // OK
60 //expected-error@+2{{missing ')' after}}
61 //expected-note@+1{{to match this '('}}
62 #define V1(...) __VA_OPT__ ((())