view gcc/testsuite/g++.dg/diagnostic/redeclaration-1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

void
foo (int i)
{
  int i  // { dg-error "7:declaration of .int i. shadows a parameter" }
    (0);
  
  for (int j ;;)  // { dg-message "12:.int j. previously declared here" }
    int j  // { dg-error "9:redeclaration of .int j." }
      (0);
}

void
bar (int i)  // { dg-message "10:.int i. previously declared here" }
  try
    { }
  catch (...)
    {
      int i  // { dg-error "11:redeclaration of .int i." }
	(0);
    }