(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
cpp1z/
init-statement9.C
// { dg-do compile { target c++17 } }

void
f ()
{
  {
    int c;
    if (int c = 2; c != 0)
      int c = 4; // { dg-error "redeclaration" }
  }

  if (int c = 2; c != 0)
    int c = 4; // { dg-error "redeclaration" }

  if (int c = 2; int c = 6) // { dg-error "redeclaration" }
    int c = 4; // { dg-error "redeclaration" }
}