This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47444] False warning: array subscript is above array bounds
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Jan 2011 21:17:18 +0000
- Subject: [Bug c++/47444] False warning: array subscript is above array bounds
- Auto-submitted: auto-generated
- References: <bug-47444-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47444
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-01-24 21:17:15 UTC ---
if ( i>=SIZE && f1() )
throw 1;
bool v[SIZE] = { 1, 1 };
return v[i];
If f1 returns false, then you have above array bounds access.
>because constructor of struct A never called with "bad"
How can that be true if the compiler does not know that or could figure that
out?