From: Paolo Carlini Date: Thu, 15 Feb 2018 18:05:40 +0000 (+0000) Subject: re PR c++/84330 ([concepts] ICE with broken constraint) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4779063140d6dc06de57d489923c91df7513f374;p=gcc.git 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 --- 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" } + } +};