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++/47444] False warning: array subscript is above array bounds


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?


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