re PR c++/84980 ([concepts] ICE with missing typename in concept)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 3 Sep 2018 07:57:33 +0000 (07:57 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 3 Sep 2018 07:57:33 +0000 (07:57 +0000)
/cp
2018-09-03  Paolo Carlini  <paolo.carlini@oracle.com>

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

/testsuite
2018-09-03  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84980
* g++.dg/concepts/pr84980.C: New.

From-SVN: r264051

gcc/cp/ChangeLog
gcc/cp/constraint.cc
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/concepts/pr84980.C [new file with mode: 0644]

index cec14d5d53f93144fdfe63c14b7edafc631e2728..55d82903256c4837da6988b794ab3a0008a8c956 100644 (file)
@@ -1,3 +1,9 @@
+2018-09-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84980
+       * constraint.cc (finish_shorthand_constraint): Early return if the
+       constraint is erroneous.
+
 2018-09-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
        * decl.c (eval_check_narrowing): Remove.
index 9f9fb52356e53f33053a4355f294b4bde03559ae..7b32355b106e2b8899c39c0f8d0d5a5388c47f48 100644 (file)
@@ -1259,6 +1259,9 @@ finish_shorthand_constraint (tree decl, tree constr)
   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 e4eaeb7ef82962700e8853006104f8e6339ecb84..b8c9e1a633ccb9491ea45818bac0f81f741b70e2 100644 (file)
@@ -1,3 +1,8 @@
+2018-09-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84980
+       * g++.dg/concepts/pr84980.C: New.
+
 2018-09-03  Martin Liska  <mliska@suse.cz>
 
        PR middle-end/59521
diff --git a/gcc/testsuite/g++.dg/concepts/pr84980.C b/gcc/testsuite/g++.dg/concepts/pr84980.C
new file mode 100644 (file)
index 0000000..619c0bd
--- /dev/null
@@ -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;