This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31952] New: parameters may be redeclared in a function try-block
- From: "andrew dot stubbs at st dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 May 2007 13:13:02 -0000
- Subject: [Bug c++/31952] New: parameters may be redeclared in a function try-block
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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