brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · f318a08 Raw
77 lines · cpp
1// RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wno-c++23-extensions -pedantic -std=c++202// RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wno-c++23-extensions -pedantic -std=c++113// RUN: %clang_cc1 -x c %s -Eonly -verify -Wno-all -Wno-c2x-extensions -pedantic -std=c994 5//expected-error@+1{{missing '('}}6#define V1(...) __VA_OPT__7#undef V18// OK9#define V1(...) __VA_OPT__  ()10#undef V111 12//expected-warning@+1{{can only appear in the expansion of a variadic macro}}13#define V2() __VA_OPT__(x)14#undef V215 16//expected-error@+2{{missing ')' after}}17//expected-note@+1{{to match this '('}}18#define V3(...) __VA_OPT__(19#undef V320 21#define V4(...) __VA_OPT__(__VA_ARGS__)22#undef V423 24//expected-error@+1{{nested}}25#define V5(...) __VA_OPT__(__VA_OPT__())26#undef V527 28//expected-error@+1{{not followed by}}29#define V1(...) __VA_OPT__  (#)30#undef V131 32//expected-error@+1{{cannot appear at start}}33#define V1(...) __VA_OPT__  (##)34#undef V135 36//expected-error@+1{{cannot appear at start}}37#define V1(...) __VA_OPT__  (## X) x38#undef V139 40//expected-error@+1{{cannot appear at end}}41#define V1(...) y __VA_OPT__  (X ##)42#undef V143 44 45#define FOO(x,...) # __VA_OPT__(x) #x #__VA_OPT__(__VA_ARGS__) //OK46 47//expected-error@+1{{not followed by a macro parameter}}48#define V1(...) __VA_OPT__(#)49#undef V150 51//expected-error@+1{{cannot appear at start}}52#define V1(...) a __VA_OPT__(##) b53#undef V154 55//expected-error@+1{{cannot appear at start}}56#define V1(...) a __VA_OPT__(a ## b) b __VA_OPT__(##)57#undef V158 59#define V1(x,...) # __VA_OPT__(b x) // OK60#undef V161 62//expected-error@+2{{missing ')' after}}63//expected-note@+1{{to match this '('}}64#define V1(...) __VA_OPT__  ((())65#undef V166 67// __VA_OPT__ can't appear anywhere else.68#if __VA_OPT__ // expected-warning {{__VA_OPT__ can only appear in the expansion of a variadic macro}}69#endif70 71// expected-warning@+2 {{__VA_OPT__ can only appear in the expansion of a variadic macro}}72#ifdef __VA_OPT__ // expected-warning {{__VA_OPT__ can only appear in the expansion of a variadic macro}}73#elifdef __VA_OPT__74#endif75 76#define BAD __VA_OPT__ // expected-warning {{__VA_OPT__ can only appear in the expansion of a variadic macro}}77