[Bug c++/109775] gcc misidentifies a VLA

2023-05-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109775 Andrew Pinski changed: What|Removed |Added Depends on||61259 --- Comment #5 from Andrew Pinski

[Bug c++/109775] gcc misidentifies a VLA

2023-05-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109775 --- Comment #4 from Andrew Pinski --- Here is another related testcase: ``` typedef int T; void naimul(const T v_[2]) { int i = 0; T pp(T(v_[0])+0); } ``` We get an -pedantic-error dealing with 0 sized array: : In function 'void naimul(const

[Bug c++/109775] gcc misidentifies a VLA

2023-05-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109775 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2023-05-08 Status|UNCONFIRM

[Bug c++/109775] gcc misidentifies a VLA

2023-05-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109775 --- Comment #2 from Andrew Pinski --- Created attachment 55022 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55022&action=edit Non reduced testcase

[Bug c++/109775] gcc misidentifies a VLA

2023-05-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109775 --- Comment #1 from Andrew Pinski --- It has to do with parsing here: GCC starts parsing it as a function declaration and then backs out but had already warned/errored out about the VLA. If you change the code to: D const pp{D(v_[i]) * o.v_[S -