[Bug c++/95735] ICE on invalid non-type template argument

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 18 13:33:37 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95735

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The second test ICEs with gcc 6 too.

Patch:
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10154,6 +10154,8 @@ finish_template_variable (tree var, tsubst_flags_t
complain)
   arglist = coerce_innermost_template_parms (parms, arglist, templ, complain,
                         /*req_all*/true,
                         /*use_default*/true);
+  if (arglist == error_mark_node)
+    return error_mark_node;

   if (flag_concepts && !constraints_satisfied_p (templ, arglist))
     {


More information about the Gcc-bugs mailing list