Re: c++/10852: Old for-scoping rules improperly used?
Gabriel Dos Reis <[email protected]>
| Newsgroups | gmane.comp.gcc.prs |
|---|---|
| Message-ID | <[email protected]> |
The following reply was made to PR c++/10852; it has been noted by GNATS. From: Gabriel Dos Reis <[email protected]> To: [email protected] Cc: [email protected] Subject: Re: c++/10852: Old for-scoping rules improperly used? Date: 19 May 2003 10:15:54 +0200 [email protected] writes: | I think this is a bug in g++; but there is always the possibility that it is a bug in my understanding of C++. In the following code gcc assumes that the variable i at the end of function is the same as in the for loop and produces the following error: | nstest.cc: In function `void f()': | nstest.cc:9: error: name lookup of `i' changed for new ISO `for' scoping | nstest.cc:6: error: using obsolete binding at `i' That is a bug in the compiler. The compiler should first look into X before complaining. -- Gaby