Commit 7296c0c5 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/90138 (ICE on invalid in contains_struct_check())

	PR c++/90138
	* pt.c (process_template_parm): Set decl to pushdecl result.  If
	!is_non_type, also set parm to that.

	* g++.dg/template/pr90138.C: New test.

From-SVN: r270456
parent c280b7ee
2019-04-19 Jakub Jelinek <jakub@redhat.com> 2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR c++/90138
* pt.c (process_template_parm): Set decl to pushdecl result. If
!is_non_type, also set parm to that.
PR c/89888 PR c/89888
* decl.c (struct cp_switch): Remove outside_range_p member. * decl.c (struct cp_switch): Remove outside_range_p member.
(push_switch): Don't clear it. (push_switch): Don't clear it.
......
...@@ -4433,7 +4433,9 @@ process_template_parm (tree list, location_t parm_loc, tree parm, ...@@ -4433,7 +4433,9 @@ process_template_parm (tree list, location_t parm_loc, tree parm,
process_template_parm could fail. */ process_template_parm could fail. */
tree reqs = finish_shorthand_constraint (parm, constr); tree reqs = finish_shorthand_constraint (parm, constr);
pushdecl (decl); decl = pushdecl (decl);
if (!is_non_type)
parm = decl;
/* Build the parameter node linking the parameter declaration, /* Build the parameter node linking the parameter declaration,
its default argument (if any), and its constraints (if any). */ its default argument (if any), and its constraints (if any). */
......
2019-04-19 Jakub Jelinek <jakub@redhat.com> 2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR c++/90138
* g++.dg/template/pr90138.C: New test.
PR c/89888 PR c/89888
* c-c++-common/pr89888.c: New test. * c-c++-common/pr89888.c: New test.
* g++.dg/torture/pr40335.C: Change dg-bogus into dg-warning. * g++.dg/torture/pr40335.C: Change dg-bogus into dg-warning.
......
// PR c++/90138
template <, typename T, typename typename, typename T> // { dg-error "expected" }
struct S; // { dg-error "no default" }
// { dg-error "two or more" "" { target *-*-* } .-2 }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment