re PR c++/77830 (internal compiler error: in output_constructor_regular_field, at...
authorJakub Jelinek <jakub@redhat.com>
Wed, 21 Dec 2016 21:58:23 +0000 (22:58 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 21 Dec 2016 21:58:23 +0000 (22:58 +0100)
commitbc2a38dff859fcd1ec0aedd8c7d0fb748f2dbede
treef329df2339ddea40f6053ce6ac5b7a32624c58b6
parent31bfc9b9dd65ecddff3afa690906d94ef7b773da
re PR c++/77830 (internal compiler error: in output_constructor_regular_field, at varasm.c:4968, when using constexpr (with testcase))

PR c++/77830
* constexpr.c (cxx_eval_array_reference): Perform out of bounds
verification even if lval is true, just allow one past the last
element in that case.
(cxx_eval_store_expression): Detect stores to out of bound
ARRAY_REF.

* g++.dg/cpp1y/pr77830.C: New test.
* g++.dg/cpp0x/pr65398.C: Adjust expected diagnostics.

From-SVN: r243873
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr65398.C
gcc/testsuite/g++.dg/cpp1y/pr77830.C [new file with mode: 0644]