This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65398] [5 Regression] [C++11] GCC rejects constexpr variable definitions with valid initialization
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 Mar 2015 18:39:48 +0000
- Subject: [Bug c++/65398] [5 Regression] [C++11] GCC rejects constexpr variable definitions with valid initialization
- Auto-submitted: auto-generated
- References: <bug-65398-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65398
--- Comment #11 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Mon Mar 30 18:39:17 2015
New Revision: 221777
URL: https://gcc.gnu.org/viewcvs?rev=221777&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/pr65398-2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c
trunk/gcc/testsuite/ChangeLog