aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constraint.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2020-02-04 17:18:35 -0500
committerJason Merrill <jason@redhat.com>2020-02-04 17:25:09 -0500
commit85409531ff032a008ebfbb715344648f15492dac (patch)
treeb921d2b26e88dd58a1501ccd1f25b266a0506e4e /gcc/cp/constraint.cc
parent0712ea6313bc44f9ae8feb235c1b02c92cdd0527 (diff)
downloadgcc-85409531ff032a008ebfbb715344648f15492dac.zip
gcc-85409531ff032a008ebfbb715344648f15492dac.tar.gz
gcc-85409531ff032a008ebfbb715344648f15492dac.tar.bz2
c++: Fix error-recovery with concepts.
Here, push_tinst_level refused to push into the scope of Foo::Foo because it was triggered from the ill-formed function fun. But we didn't check the return value and tried to pop the un-pushed level. PR c++/93551 * constraint.cc (satisfy_declaration_constraints): Check return value of push_tinst_level.
Diffstat (limited to 'gcc/cp/constraint.cc')
-rw-r--r--gcc/cp/constraint.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc
index cda644e..58044cd 100644
--- a/gcc/cp/constraint.cc
+++ b/gcc/cp/constraint.cc
@@ -2692,7 +2692,8 @@ satisfy_declaration_constraints (tree t, subst_info info)
tree result = boolean_true_node;
if (norm)
{
- push_tinst_level (t);
+ if (!push_tinst_level (t))
+ return result;
push_access_scope (t);
result = satisfy_associated_constraints (norm, args, info);
pop_access_scope (t);