re PR c++/65398 ([C++11] GCC rejects constexpr variable definitions with valid initia...
authorMarek Polacek <polacek@redhat.com>
Mon, 30 Mar 2015 18:39:17 +0000 (18:39 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 30 Mar 2015 18:39:17 +0000 (18:39 +0000)
commitef4bac7802534e52d3031dccf0cdfb2c53b2d836
tree05c8ccb5585dce489c8e83023f76d83a742cb992
parent6c384511a36aa97eda218a2935fe3a14720e3b59
re PR c++/65398 ([C++11] GCC rejects constexpr variable definitions with valid initialization)

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.

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