aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2018-09-03 07:57:33 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2018-09-03 07:57:33 +0000
commitd1dfeff07917739fd5ae157be0825a757c576bef (patch)
tree32dabcfe0e5c435de8f06bf79f04fe59af02de97
parentadd4cbca8cf60d1108959de10a6c4b66d90464dc (diff)
downloadgcc-d1dfeff07917739fd5ae157be0825a757c576bef.zip
gcc-d1dfeff07917739fd5ae157be0825a757c576bef.tar.gz
gcc-d1dfeff07917739fd5ae157be0825a757c576bef.tar.bz2
re PR c++/84980 ([concepts] ICE with missing typename in concept)
/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
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/constraint.cc3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/concepts/pr84980.C6
4 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cec14d5..55d8290 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc
index 9f9fb52..7b32355 100644
--- a/gcc/cp/constraint.cc
+++ b/gcc/cp/constraint.cc
@@ -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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e4eaeb7..b8c9e1a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..619c0bd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/pr84980.C
@@ -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;