Better not to ICE after various valid errors.
PR c++/108972
gcc/cp/ChangeLog:
* lambda.cc (compare_lambda_template_head): Check more
for error_mark_node.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-lambda3.C: Run at lower std levels,
but expect errors.
if (parm_a == error_mark_node)
return false;
parm_a = TREE_VALUE (parm_a);
+ if (parm_a == error_mark_node)
+ return false;
if (DECL_VIRTUAL_P (parm_a))
parm_a = NULL_TREE;
}
if (parm_b == error_mark_node)
return false;
parm_b = TREE_VALUE (parm_b);
+ if (parm_b == error_mark_node)
+ return false;
if (DECL_VIRTUAL_P (parm_b))
parm_b = NULL_TREE;
}
-// { dg-do run { target c++20 } }
+// { dg-do run }
+// { dg-excess-errors "" { target { ! concepts } } } (PR108972)
template<typename T>
concept C1 = __is_same_as(T, int)
return 0;
}
-