PR c++/48212
* semantics.c (non_const_var_error): Just return if DECL_INITIAL
is error_mark_node.
From-SVN: r171748
+2011-03-30 Jason Merrill <jason@redhat.com>
+
+ PR c++/48212
+ * semantics.c (non_const_var_error): Just return if DECL_INITIAL
+ is error_mark_node.
+
2011-03-30 Jason Merrill <jason@redhat.com>
PR c++/48369
tree type = TREE_TYPE (r);
error ("the value of %qD is not usable in a constant "
"expression", r);
+ /* Avoid error cascade. */
+ if (DECL_INITIAL (r) == error_mark_node)
+ return;
if (DECL_DECLARED_CONSTEXPR_P (r))
inform (DECL_SOURCE_LOCATION (r),
"%qD used in its own initializer", r);
2011-03-30 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/regress/error-recovery1.C: New.
+
* g++.dg/cpp0x/regress/isnan.C: New.
* g++.dg/cpp0x/initlist46.C: New.
--- /dev/null
+// PR c++/48212
+// { dg-options -std=c++0x }
+
+template < bool > void
+foo ()
+{
+ const bool b =; // { dg-error "" }
+ foo < b > (); // { dg-error "constant expression" }
+};