/cp
2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56582
* semantics.c (cxx_eval_array_reference): Check for negative index.
/testsuite
2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56582
* g++.dg/cpp0x/constexpr-array5.C: New.
From-SVN: r196701
+2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56582
+ * semantics.c (cxx_eval_array_reference): Check for negative index.
+
2013-03-14 Jason Merrill <jason@redhat.com>
PR c++/56614
*non_constant_p = true;
return t;
}
+ else if (tree_int_cst_lt (index, integer_zero_node))
+ {
+ if (!allow_non_constant)
+ error ("negative array subscript");
+ *non_constant_p = true;
+ return t;
+ }
i = tree_low_cst (index, 0);
if (TREE_CODE (ary) == CONSTRUCTOR)
return (*CONSTRUCTOR_ELTS (ary))[i].value;
+2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56582
+ * g++.dg/cpp0x/constexpr-array5.C: New.
+
2013-03-15 Tobias Burnus <burnus@net-b.de>
- PR fortran/56615
- * gfortran.dg/transfer_intrinsic_5.f90: New.
+ PR fortran/56615
+ * gfortran.dg/transfer_intrinsic_5.f90: New.
2013-03-15 Kai Tietz <ktietz@redhat.com>
--- /dev/null
+// PR c++/56582
+// { dg-do compile { target c++11 } }
+
+// Reliable ICE
+constexpr int n[3] = {};
+constexpr int k = n[-1]; // { dg-error "negative" }
+
+// Some random byte
+constexpr char c = "foo"[-1000]; // { dg-error "negative" }