diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/constexpr.c | 5 |
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 |