[Bug c++/10852] Old for-scoping rules improperly used?

reichelt at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Mar 7 15:54:00 GMT 2006



------- 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



More information about the Gcc-bugs mailing list