PR c++/77830
commitcf3cefc9f45a67e1109038fb6c730e557ec1d07e
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Dec 2016 21:58:23 +0000 (21 21:58 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Dec 2016 21:58:23 +0000 (21 21:58 +0000)
treef329df2339ddea40f6053ce6ac5b7a32624c58b6
parent7806e079290fe3c02fca172f792b7f653ba4cf39
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243873 138bc75d-0d04-0410-961f-82ee72b054a4
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]