This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/31952] New: parameters may be redeclared in a function try-block


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]