This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33260] New: For scope warning despite -ffor-scope
- From: "gcc at david dot osborn dot name" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Aug 2007 09:04:34 -0000
- Subject: [Bug c++/33260] New: For scope warning despite -ffor-scope
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program produces a variable scope warning, even when compiled
with -ffor-scope, preventing use of -Werror. The documentation only mentions
warnings being generated if the flag is not given.
int main()
{
int i;
{
for (int i = 0; i < 100; ++i);
return i;
}
}
g++ -ffor-scope -Werror -otest test.cpp
cc1plus.exe: warnings being treated as errors
test.cpp: In function 'int main()':
test.cpp:6: warning: name lookup of 'i' changed
test.cpp:3: warning: matches this 'i' under ISO standard rules
test.cpp:5: warning: matches this 'i' under old rules
--
Summary: For scope warning despite -ffor-scope
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gcc at david dot osborn dot name
GCC build triplet: i686-pc-mingw32
GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33260