diff options
author | Richard Guenther <rguenther@suse.de> | 2016-11-14 15:42:40 +0100 |
---|---|---|
committer | Richard Guenther <rguenther@suse.de> | 2016-11-14 15:42:40 +0100 |
commit | ca94f8c64654980144e88fb19b04adf5f023aa55 (patch) | |
tree | ef90f8461d210f78e7f7b0ba89923a5eda7b3758 /gcc/cp/constexpr.c | |
parent | 9e872f3fe8b4f6624e2edf5ee55a833e53f290c8 (diff) | |
parent | 5dc46e164993bbf658f61069823a1b37a2d715eb (diff) | |
download | gcc-gimplefe.tar.gz |
Merge remote-tracking branch 'trunk' of git://gcc.gnu.org/git/gcc into gimplefegimplefe
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r-- | gcc/cp/constexpr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index f75f0b039fa..e8c7702dede 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -3770,7 +3770,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, return (*ctx->values->get (t)); case VAR_DECL: - if (is_capture_proxy (t)) + if (DECL_HAS_VALUE_EXPR_P (t)) return cxx_eval_constant_expression (ctx, DECL_VALUE_EXPR (t), lval, non_constant_p, overflow_p); /* fall through */ @@ -5037,6 +5037,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, return RECUR (TREE_OPERAND (t, 0), rval); case VAR_DECL: + if (DECL_HAS_VALUE_EXPR_P (t)) + return RECUR (DECL_VALUE_EXPR (t), rval); if (want_rval && !var_in_maybe_constexpr_fn (t) && !type_dependent_expression_p (t) @@ -5105,6 +5107,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, #endif return RECUR (t, any); + case REALPART_EXPR: + case IMAGPART_EXPR: case COMPONENT_REF: case BIT_FIELD_REF: case ARROW_EXPR: @@ -5276,8 +5280,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, return true; /* fall through. */ - case REALPART_EXPR: - case IMAGPART_EXPR: case CONJ_EXPR: case SAVE_EXPR: case FIX_TRUNC_EXPR: |