From 4779063140d6dc06de57d489923c91df7513f374 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 15 Feb 2018 18:05:40 +0000 Subject: [PATCH] re PR c++/84330 ([concepts] ICE with broken constraint) /cp 2018-02-15 Paolo Carlini PR c++/84330 * constraint.cc (tsubst_constraint_info): Handle an error_mark_node as first argument. /testsuite 2018-02-15 Paolo Carlini PR c++/84330 * g++.dg/concepts/pr84330.C: New. From-SVN: r257698 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/constraint.cc | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/concepts/pr84330.C | 12 ++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/concepts/pr84330.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6c95dfe3a62..f7fd4e36278 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-02-15 Paolo Carlini + + PR c++/84330 + * constraint.cc (tsubst_constraint_info): Handle an error_mark_node + as first argument. + 2018-02-14 Paolo Carlini PR c++/84350 diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index 622c9fe97a5..37eded17c94 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -1918,7 +1918,7 @@ tsubst_constraint_info (tree t, tree args, tree tsubst_constraint (tree t, tree args, tsubst_flags_t complain, tree in_decl) { - if (t == NULL_TREE) + if (t == NULL_TREE || t == error_mark_node) return t; switch (TREE_CODE (t)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3d6da2a9ca4..91e14ced710 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-15 Paolo Carlini + + PR c++/84330 + * g++.dg/concepts/pr84330.C: New. + 2018-02-15 Tom de Vries * gcc.dg/Wstringop-overflow-3.c: Require effective target alloca. diff --git a/gcc/testsuite/g++.dg/concepts/pr84330.C b/gcc/testsuite/g++.dg/concepts/pr84330.C new file mode 100644 index 00000000000..975ee8941db --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/pr84330.C @@ -0,0 +1,12 @@ +// PR c++/84330 +// { dg-options "-fconcepts" } + +struct A +{ + template requires sizeof(T) >> 0 void foo(T); // { dg-error "predicate constraint" } + + void bar() + { + foo(0); // { dg-error "no matching" } + } +}; -- 2.30.2