aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-01-23 09:59:10 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-01-23 09:59:10 -0500
commit7c83622c6b1c95cdeb12fa5e6b0ef294c78eff16 (patch)
treecbf615644ffbf18debd6560b60553df1b6d713bf /gcc
parent350d17ef90124728f0fc6614eab35bff62dc87a5 (diff)
downloadgcc-7c83622c6b1c95cdeb12fa5e6b0ef294c78eff16.zip
gcc-7c83622c6b1c95cdeb12fa5e6b0ef294c78eff16.tar.gz
gcc-7c83622c6b1c95cdeb12fa5e6b0ef294c78eff16.tar.bz2
re PR c++/64727 (g++.dg/torture/darwin-cfstring-3.C:11:80: internal compiler error: Segmentation fault: 11)
PR c++/64727 * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use of CONST_DECL. From-SVN: r220041
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/constexpr.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6e3a2e5..b1d4965 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/64727
+ * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
+ of CONST_DECL.
+
2015-01-21 Jason Merrill <jason@redhat.com>
PR c++/64603
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 7853d37..f144ab0 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -2955,10 +2955,11 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
return (*ctx->values->get (t));
case VAR_DECL:
+ case CONST_DECL:
+ /* We used to not check lval for CONST_DECL, but darwin.c uses
+ CONST_DECL for aggregate constants. */
if (lval)
return t;
- /* else fall through. */
- case CONST_DECL:
if (ctx->strict)
r = decl_really_constant_value (t);
else