According to the C++ standard, clause 3.3.2, paragraph 2, sentence 3, the
following program should be invalid:

int
foo (int bar)
try
{
  return 0;
}
catch (...)
{
  int bar = 0; // invalid
  return 1;
}

Specifically, `bar' may not be redeclared in the outermost block of a handler
in a function try-block.

GCC 4.1.1 gives no errors or warnings (other than unused parameters and
variables).


-- 
           Summary: parameters may be redeclared in a function try-block
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot stubbs at st dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31952

Reply via email to