diff options
author | Jason Merrill <jason@redhat.com> | 2015-01-23 11:29:46 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2015-01-23 11:29:46 -0500 |
commit | c6e7c499a3f6dfd86b8b88cb1bdd70a1ebb76012 (patch) | |
tree | 72bacdd22935d1fa2cb2a47586c3f1900b956366 /gcc/cp | |
parent | 6fc2d0f36223308d21f2347c9b48bc61fed2405c (diff) | |
download | gcc-c6e7c499a3f6dfd86b8b88cb1bdd70a1ebb76012.zip gcc-c6e7c499a3f6dfd86b8b88cb1bdd70a1ebb76012.tar.gz gcc-c6e7c499a3f6dfd86b8b88cb1bdd70a1ebb76012.tar.bz2 |
re PR c++/64701 (internal compiler error: unexpected expression ‘<statement>’ of kind do_stmt)
PR c++/64701
* constexpr.c (maybe_constant_value): Just hand back STATEMENT_LIST.
From-SVN: r220046
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/constexpr.c | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b1d4965..98bbcbd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2015-01-23 Jason Merrill <jason@redhat.com> + PR c++/64701 + * constexpr.c (maybe_constant_value): Just hand back STATEMENT_LIST. + PR c++/64727 * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use of CONST_DECL. diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index f144ab0..f143420 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -3454,8 +3454,18 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, break; default: - internal_error ("unexpected expression %qE of kind %s", t, - get_tree_code_name (TREE_CODE (t))); + if (STATEMENT_CODE_P (TREE_CODE (t))) + { + /* This function doesn't know how to deal with pre-genericize + statements; this can only happen with statement-expressions, + so for now just fail. */ + if (!ctx->quiet) + error_at (EXPR_LOCATION (t), + "statement is not a constant-expression"); + } + else + internal_error ("unexpected expression %qE of kind %s", t, + get_tree_code_name (TREE_CODE (t))); *non_constant_p = true; break; } |