(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
pr58346-3.c
       1  /* PR c/58346 */
       2  /* { dg-do compile } */
       3  
       4  void
       5  foo (void)
       6  {
       7    __PTRDIFF_TYPE__ d;
       8    const int i = 0;
       9    int a1[2][0], a2[2][0];
      10    int b1[3][i], b2[4][i];
      11    d = a1 - a2; /* { dg-error "arithmetic on pointer to an empty aggregate" } */
      12    __asm volatile ("" : "+g" (d));
      13    /* No error here for C.  */
      14    d = b1 - b2; /* { dg-error "arithmetic on pointer to an empty aggregate" "" { target c++ } } */
      15    __asm volatile ("" : "+g" (d));
      16  }