This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18770] New: g++ accepts invalid code
- From: "seefeld at sympatico dot ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Dec 2004 23:05:49 -0000
- Subject: [Bug c++/18770] New: g++ accepts invalid code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
According to ISO/IEC 14882 6.4-3, the following snippet is ill-formed:
if (int x = 1)
{
int x = 2; // redeclaration of x
}
Yet the g++ versions that come with Fedora Core 3 accept it.
Specifically, these versions are:
gcc version 3.3.4 20040817 (Red Hat Linux 3.3.4-2)
gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
gcc version 4.0.0 20041019 (Red Hat 4.0.0-0.8)
--
Summary: g++ accepts invalid code
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: seefeld at sympatico dot ca
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: GNU/Linux x86
GCC host triplet: GNU/Linux x86
GCC target triplet: GNU/Linux x86
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18770