cp_parser_template_id wasn't prepared to handle getting a USING_DECL back
from cp_parser_template_name. Let's defer that case to instantiation time,
as well.
PR c++/104235
gcc/cp/ChangeLog:
* parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
gcc/testsuite/ChangeLog:
* g++.dg/parse/template-keyword2.C: New test.
cp_parser_error (parser, "expected template-name");
return error_mark_node;
}
- else if (!DECL_P (decl) && !is_overloaded_fn (decl))
+ else if ((!DECL_P (decl) && !is_overloaded_fn (decl))
+ || TREE_CODE (decl) == USING_DECL)
/* Repeat the lookup at instantiation time. */
decl = identifier;
}
--- /dev/null
+// PR c++/104235
+
+template <class M>
+struct L: M {
+ using M::a;
+ void a();
+ void p() { this->template a<>(); }
+};