Hi,

another straightforward ICE on invalid.  I spent however quite a bit of time on it, because I tried to catch the error_mark_node as early as possible, but that doesn't seem to work well error-recovery-wise: if, say, we catch it in deduce_constrained_parameter we end-up emitting a second redundant "‘C’ is not a type" error message because we skip 'C' completely. Thus, at least for the time being, I propose to simply catch the problem in finish_shorthand_constraint (which likely avoids more ICEs already in Bugzilla...). Tested x86_64-linux.

Thanks, Paolo.

////////////////////////

/cp
2018-08-31  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/84980
        * constraint.cc (finish_shorthand_constraint): Early return if the
        constraint is erroneous.

/testsuite
2018-08-31  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/84980
        * g++.dg/concepts/pr84980.C: New.
Index: cp/constraint.cc
===================================================================
--- cp/constraint.cc    (revision 264009)
+++ cp/constraint.cc    (working copy)
@@ -1259,6 +1259,9 @@ finish_shorthand_constraint (tree decl, tree const
   if (!constr)
     return NULL_TREE;
 
+  if (error_operand_p (constr))
+    return NULL_TREE;
+
   tree proto = CONSTRAINED_PARM_PROTOTYPE (constr);
   tree con = CONSTRAINED_PARM_CONCEPT (constr);
   tree args = CONSTRAINED_PARM_EXTRA_ARGS (constr);
Index: testsuite/g++.dg/concepts/pr84980.C
===================================================================
--- testsuite/g++.dg/concepts/pr84980.C (nonexistent)
+++ testsuite/g++.dg/concepts/pr84980.C (working copy)
@@ -0,0 +1,6 @@
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+template<T> concept bool C = true;  // { dg-error "has not been declared" }
+
+template<C...> struct A;

Reply via email to