PR c++/65398
commit35b68da831ae24ef73c7daeeb9655b2f318c4752
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Mar 2015 18:39:17 +0000 (30 18:39 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Mar 2015 18:39:17 +0000 (30 18:39 +0000)
tree05c8ccb5585dce489c8e83023f76d83a742cb992
parent8126264b8be7e05fb1ddbeb1df4f29be745f3412
PR c++/65398
* constexpr.c (cxx_fold_indirect_ref): Don't perform the
 *(&A[i] p+ j) => A[i + j] transformation here.
(cxx_eval_pointer_plus_expression): New function.
(cxx_eval_constant_expression): Use it here.

* g++.dg/cpp0x/pr65398-2.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221777 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr65398-2.C [new file with mode: 0644]