This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/10852] Old for-scoping rules improperly used?
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Mar 2006 15:54:15 -0000
- Subject: [Bug c++/10852] Old for-scoping rules improperly used?
- References: <bug-10852-6033@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from reichelt at gcc dot gnu dot org 2006-03-07 15:54 -------
Here's an example where the code is invalid, but is accepted because
of the for-scope-warning machinery:
==================================
namespace N
{
int i;
}
int i;
void foo()
{
for (int i=0; i<10; ++i) ;
using namespace N;
i;
}
==================================
The problem is that we track old and new scoping rules simultaneously
to be able to issue warnings. This doesn't work properly in corner
cases like in this PR.
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10852