gcc/cp/ChangeLog:
PR c++/77639
* parser.c (cp_parser_class_head): When
processing_template_parmlist, don't assume that the
class-head may start an explicit specialization.
gcc/testsuite/ChangeLog:
PR c++/77639
* g++.dg/template/error-recovery4.C: New test.
From-SVN: r240245
+2016-09-16 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/77639
+ * parser.c (cp_parser_class_head): When
+ processing_template_parmlist, don't assume that the
+ class-head may start an explicit specialization.
+
2016-09-16 Jakub Jelinek <jakub@redhat.com>
PR c++/77482
it is not, try to recover gracefully. */
if (at_namespace_scope_p ()
&& parser->num_template_parameter_lists == 0
+ && !processing_template_parmlist
&& template_id_p)
{
/* Build a location of this form:
+2016-09-19 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/77639
+ * g++.dg/template/error-recovery4.C: New test.
+
2016-09-19 Bin Cheng <bin.cheng@arm.com>
* gcc.dg/vect/pr57558-1.c: Use unsigned int instead of unsigned long.
--- /dev/null
+// PR c++/77639
+
+template <class, int, class, int> struct B {};
+template <class T, int a, class U struct B<T, a, U, 1> {}; // { dg-error "" }
+B<int, 2, char, 1> i;