c++: ICE in requires-expressions with invalid args [PR95735]
authorMarek Polacek <polacek@redhat.com>
Thu, 18 Jun 2020 13:38:42 +0000 (09:38 -0400)
committerMarek Polacek <polacek@redhat.com>
Thu, 18 Jun 2020 15:51:01 +0000 (11:51 -0400)
commit5421fae8b17c7401f3a4ac5b9f414a47f7bda379
treeb88d96cc1e3a715222c69b501a1d96d9815b1ce4
parent634e6f49101c92ccb83ad3d65f975162582c5dea
c++: ICE in requires-expressions with invalid args [PR95735]

This ICE-on-invalid goes back to GCC 6.  In finish_template_variable,
if coerce_innermost_template_parms returns error_mark_node, we pass
it down to constraints_satisfied_p and that error_mark_node flows
down to various satisfy_* functions and then to various tsubst_*
functions, where we crash.  diagnose_constraints also doesn't cope
with error arglist, so I think we should just return as in the
patch below.

gcc/cp/ChangeLog:

PR c++/95735
* pt.c (finish_template_variable): Return if
coerce_innermost_template_parms return error_mark_node.

gcc/testsuite/ChangeLog:

PR c++/95735
* g++.dg/cpp2a/concepts-err2.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/concepts-err2.C [new file with mode: 0644]