https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94938
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
value_dependent_expression_p (called via the new uses_template_parms call)
doesn't expect a non-constant expression.  So one possible fix would be:

--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10624,7 +10624,8 @@ uses_template_parms (tree t)
   else if (t == error_mark_node)
     dependent_p = false;
   else
-    dependent_p = value_dependent_expression_p (t);
+    dependent_p = (potential_constant_expression (t)
+          && value_dependent_expression_p (t));

   processing_template_decl = saved_processing_template_decl;

Reply via email to