| 1 |
/* { dg-do preprocess } */ |
| 2 |
/* { dg-options "-std=gnu99" { target c } } */ |
| 3 |
/* { dg-options "-std=c++20" { target c++ } } */ |
| 4 |
|
| 5 |
#define a "" |
| 6 |
#define b(...) a ## #__VA_OPT__(1) /* { dg-error "pasting \"a\" and \"\"\"\" does not give a valid preprocessing token" } */ |
| 7 |
#define c(...) a ## #__VA_OPT__(1) /* { dg-error "pasting \"a\" and \"\"1\"\" does not give a valid preprocessing token" } */ |
| 8 |
#define d(...) #__VA_OPT__(1) ## ! |
| 9 |
#define e(...) #__VA_OPT__(1) ## ! |
| 10 |
#define f(...) #__VA_OPT__(. ## !) |
| 11 |
#define g(...) #__VA_OPT__(. ## !) |
| 12 |
b() |
| 13 |
c(1) |
| 14 |
d( ) /* { dg-error "pasting \"\"\"\" and \"!\" does not give a valid preprocessing token" } */ |
| 15 |
e( 1 ) /* { dg-error "pasting \"\"1\"\" and \"!\" does not give a valid preprocessing token" } */ |
| 16 |
f() |
| 17 |
g(0) /* { dg-error "pasting \".\" and \"!\" does not give a valid preprocessing token" } */ |