[Bug c++/89149] Out of bounds array access not detected as ill-formed in a constant expression context in some cases

2019-02-07 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89149 Martin Sebor changed: What|Removed |Added Keywords||diagnostic Status|UNCONFIRMED

[Bug c++/89149] Out of bounds array access not detected as ill-formed in a constant expression context in some cases

2019-02-01 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89149 --- Comment #4 from rguenther at suse dot de --- On Fri, 1 Feb 2019, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89149 > > --- Comment #3 from Jakub Jelinek --- > That fold_build_pointer_plus_loc looks premat

[Bug c++/89149] Out of bounds array access not detected as ill-formed in a constant expression context in some cases

2019-02-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89149 --- Comment #3 from Jakub Jelinek --- That fold_build_pointer_plus_loc looks premature to me in any case given the desire to delay folding. We have tons of those through the C as well as C++ FEs though. E.g. pointer_int_sum calls: fold_build2_lo

[Bug c++/89149] Out of bounds array access not detected as ill-formed in a constant expression context in some cases

2019-02-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89149 --- Comment #2 from Richard Biener --- If you ask the middle-end about such expressions you get its view. So if you want to apply language semantics you need to avoid folding it with those routines.

[Bug c++/89149] Out of bounds array access not detected as ill-formed in a constant expression context in some cases

2019-02-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89149 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org,