aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-10-30 13:30:10 -0400
committerJason Merrill <jason@gcc.gnu.org>2013-10-30 13:30:10 -0400
commit3e4403a4c4affc7ba55f69136e74c25a0a74d84e (patch)
tree830431eb5598391fd06cf859a26254f647041dc5
parent1652c6dada46168fc129de93fda4146624e0ff15 (diff)
downloadgcc-3e4403a4c4affc7ba55f69136e74c25a0a74d84e.zip
gcc-3e4403a4c4affc7ba55f69136e74c25a0a74d84e.tar.gz
gcc-3e4403a4c4affc7ba55f69136e74c25a0a74d84e.tar.bz2
* decl.c (cp_finish_decl): Never throw for VLA bound == 0.
From-SVN: r204218
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0d329b5..da1d7f9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2013-10-30 Jason Merrill <jason@redhat.com>
+
+ * decl.c (cp_finish_decl): Never throw for VLA bound == 0.
+
2013-10-29 David Malcolm <dmalcolm@redhat.com>
Patch autogenerated by refactor_symtab.py from
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 1e92f2a..476d559 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6404,11 +6404,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
/* If the VLA bound is larger than half the address space, or less
than zero, throw std::bad_array_length. */
tree max = convert (ssizetype, TYPE_MAX_VALUE (TYPE_DOMAIN (type)));
- /* C++1y says we should throw for length <= 0, but we have
- historically supported zero-length arrays. Let's treat that as an
- extension to be disabled by -std=c++NN. */
- int lower = flag_iso ? 0 : -1;
- tree comp = build2 (LT_EXPR, boolean_type_node, max, ssize_int (lower));
+ tree comp = build2 (LT_EXPR, boolean_type_node, max, ssize_int (-1));
comp = build3 (COND_EXPR, void_type_node, comp,
throw_bad_array_length (), void_zero_node);
finish_expr_stmt (comp);