+2019-02-01 Marek Polacek <polacek@redhat.com>
+
+ PR c++/88325 - ICE with invalid out-of-line template member definition.
+ * parser.c (cp_parser_class_name): Don't call make_typename_type
+ for overloads.
+
2019-02-01 Jakub Jelinek <jakub@redhat.com>
PR c++/87175
decl = cp_parser_maybe_treat_template_as_class (decl, class_head_p);
/* If this is a typename, create a TYPENAME_TYPE. */
- if (typename_p && decl != error_mark_node)
+ if (typename_p
+ && decl != error_mark_node
+ && !is_overloaded_fn (decl))
{
decl = make_typename_type (scope, decl, typename_type,
/*complain=*/tf_error);
+2019-02-01 Marek Polacek <polacek@redhat.com>
+
+ PR c++/88325 - ICE with invalid out-of-line template member definition.
+ * g++.dg/cpp2a/typename14.C: New test.
+
2019-02-01 Richard Biener <rguenther@suse.de>
PR middle-end/88597
--- /dev/null
+// PR c++/88325
+// { dg-do compile { target c++2a } }
+
+template<typename> struct A
+{
+ template<typename> A ();
+};
+
+template<typename T>
+template<typename U>
+A<T>::A<U> () // { dg-error "partial specialization" }
+{
+}
+
+template<typename> struct B
+{
+ template<typename> int foo (int);
+};
+
+template<typename T>
+template<typename U>
+B<T>::foo<int>(int) // { dg-error "partial specialization|declaration" }
+{
+ return 1;
+}