This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18770] g++ accepts invalid code with scopes on ifs
- From: "akyrtzi at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Oct 2008 09:09:47 -0000
- Subject: [Bug c++/18770] g++ accepts invalid code with scopes on ifs
- References: <bug-18770-2491@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from akyrtzi at gmail dot com 2008-10-08 09:09 -------
Note that the same rule applies to the 'switch' statement too:
switch (int x = 1)
{
default:
int x = 2; // there should be an error because of redeclaration
}
--
akyrtzi at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |akyrtzi at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18770