From: Jason Merrill Date: Fri, 23 Jan 2015 14:59:10 +0000 (-0500) Subject: re PR c++/64727 (g++.dg/torture/darwin-cfstring-3.C:11:80: internal compiler error... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7c83622c6b1c95cdeb12fa5e6b0ef294c78eff16;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6e3a2e566fa..b1d4965cc39 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-01-23 Jason Merrill + + PR c++/64727 + * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use + of CONST_DECL. + 2015-01-21 Jason Merrill PR c++/64603 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 7853d377849..f144ab01d24 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