This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]