From 8d9721cc670c8b9186e3ebb0168d9931eacc2cb8 Mon Sep 17 00:00:00 2001 From: paolo Date: Mon, 3 Sep 2018 07:57:33 +0000 Subject: [PATCH] /cp 2018-09-03 Paolo Carlini PR c++/84980 * constraint.cc (finish_shorthand_constraint): Early return if the constraint is erroneous. /testsuite 2018-09-03 Paolo Carlini PR c++/84980 * g++.dg/concepts/pr84980.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264051 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/constraint.cc | 3 +++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/concepts/pr84980.C | 6 ++++++ 4 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.dg/concepts/pr84980.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cec14d5d53f..55d82903256 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-09-03 Paolo Carlini + + PR c++/84980 + * constraint.cc (finish_shorthand_constraint): Early return if the + constraint is erroneous. + 2018-09-02 Bernd Edlinger * decl.c (eval_check_narrowing): Remove. diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index 9f9fb52356e..7b32355b106 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 e4eaeb7ef82..b8c9e1a633c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-03 Paolo Carlini + + PR c++/84980 + * g++.dg/concepts/pr84980.C: New. + 2018-09-03 Martin Liska 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 00000000000..619c0bd140b --- /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 concept bool C = true; // { dg-error "has not been declared" } + +template struct A; -- 2.11.4.GIT