[Bug c++/18770] g++ accepts invalid code with scopes on ifs
akyrtzi at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 8 09:11:00 GMT 2008
------- 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
More information about the Gcc-bugs
mailing list