===================================================================
@@ -9676,7 +9677,7 @@ cxx_eval_constant_expression (const constexpr_call
build_non_dependent_expr, because any expression that
calls or takes the address of the function will have
pulled a FUNCTION_DECL out of the COMPONENT_REF. */
- gcc_checking_assert (allow_non_constant);
+ gcc_checking_assert (allow_non_constant || errorcount);
*non_constant_p = true;
return t;
}
===================================================================
@@ -0,0 +1,8 @@
+// PR c++/60215
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+ void foo();
+ int i : foo; // { dg-error "width" }
+};