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
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
* decl.c (struct cp_switch): Remove outside_range_p member.
(push_switch): Don't clear it.
process_template_parm could fail. */
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,
its default argument (if any), and its constraints (if any). */
2019-04-19 Jakub Jelinek <jakub@redhat.com>
+ PR c++/90138
+ * g++.dg/template/pr90138.C: New test.
+
PR c/89888
* c-c++-common/pr89888.c: New test.
* g++.dg/torture/pr40335.C: Change dg-bogus into dg-warning.
--- /dev/null
+// 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 }