(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
cpp/
va-opt-error.c
       1  /* { dg-do preprocess }*/
       2  /* { dg-options "-std=gnu99" { target c } } */
       3  /* { dg-options "-std=c++2a" { target c++ } } */
       4  
       5  #define ERR1(x) __VA_OPT__ /* { dg-warning "__VA_OPT__ can only appear" } */
       6  #define ERR2(x) __VA_OPT__( /* { dg-warning "can only appear" } */
       7  #define ERR3(x) __VA_OPT__() /* { dg-warning "can only appear" } */
       8  
       9  #define ERR4(x,...) __VA_OPT__ /* { dg-error "unterminated __VA_OPT__" } */
      10  #define ERR5(x,...) __VA_OPT__( /* { dg-error "unterminated" } */
      11  #define ERR6(x,...) __VA_OPT__(() /* { dg-error "unterminated" } */
      12  
      13  #define ERR7(x,...) __VA_OPT__(__VA_OPT__) /* { dg-error "may not appear" } */
      14  #define ERR7(x,...) __VA_OPT__(__VA_OPT__()) /* { dg-error "may not appear" } */
      15  
      16  #define ERR8(x, y,...) x __VA_OPT__(##) y /* { dg-error "either end" } */
      17  #define ERR9(x, y,...) x __VA_OPT__(x ##) y /* { dg-error "either end" } */
      18  #define ERRA(x, y,...) x x __VA_OPT__(## y) /* { dg-error "either end" } */
      19  
      20  #define ERRB __VA_OPT__ /* { dg-warning "can only appear" } */
      21  #define ERRC(__VA_OPT__) x /* { dg-warning "can only appear" } */
      22  
      23  __VA_OPT__ /* { dg-warning "can only appear" } */
      24  
      25  #define ERRD(x)
      26  ERRD(__VA_OPT__) /* { dg-warning "can only appear" } */
      27  
      28  #define __VA_OPT__ /* { dg-warning "can only appear" } */