PARMS, so that its template level is properly reduced and we don't get
mismatches when deducing types using the guide with PARMS. */
if (member_template_p)
- parms = tsubst (parms, DECL_TI_ARGS (tmpl), complain, init);
+ {
+ ++processing_template_decl;
+ parms = tsubst (parms, DECL_TI_ARGS (tmpl), complain, init);
+ --processing_template_decl;
+ }
}
else if (TREE_CODE (init) == TREE_LIST)
{
--- /dev/null
+// PR c++/105476
+// { dg-do compile { target c++17 } }
+
+template<class> struct Visitor_functor;
+
+template<class> struct Events {
+ template<class... Fn> struct Visitor : Visitor_functor<Fn>::type_t... { };
+};
+
+using ev_t = Events<int>;
+ev_t::Visitor v = { {} }; // { dg-error "too many initializers" }
--- /dev/null
+// PR c++/105476
+// { dg-do compile { target c++20 } }
+// A valid version of class-deduction-aggr13.C.
+
+template<class> struct Visitor_functor;
+
+template<> struct Visitor_functor<int> {
+ using type_t = int;
+};
+
+template<class T> struct Events {
+ template<class Fn=T> struct Visitor {
+ Visitor_functor<Fn>::type_t t;
+ };
+};
+
+using ev_t = Events<int>;
+ev_t::Visitor v = { {} };