re PR c++/69509 (infinite loop compiling a VLA in a recursive constexpr function)
authorMarek Polacek <polacek@redhat.com>
Fri, 29 Jan 2016 09:25:14 +0000 (09:25 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Fri, 29 Jan 2016 09:25:14 +0000 (09:25 +0000)
commit5453bfed484b93369b42fbf8c1e7750ff3ca5f85
treeeafb02c3b10525280e4825fa8103c05dc0a2a8a9
parent452ec2a5ec2e84bd6f469afb43b0928361d1710f
re PR c++/69509 (infinite loop compiling a VLA in a recursive constexpr function)

PR c++/69509
PR c++/69516
* constexpr.c (cxx_eval_array_reference): Give the "array subscript
out of bound" error earlier.
* init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
commentary.

* g++.dg/ext/constexpr-vla2.C: New test.
* g++.dg/ext/constexpr-vla3.C: New test.
* g++.dg/ubsan/vla-1.C: Remove dg-shouldfail.

From-SVN: r232969
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/init.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/constexpr-vla2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/constexpr-vla3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/vla-1.C