Commit a53a893b by Marek Polacek Committed by Marek Polacek

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.

	* g++.dg/cpp2a/typename14.C: New test.

From-SVN: r268455
parent e71ac163
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> 2019-02-01 Jakub Jelinek <jakub@redhat.com>
PR c++/87175 PR c++/87175
......
...@@ -23167,7 +23167,9 @@ cp_parser_class_name (cp_parser *parser, ...@@ -23167,7 +23167,9 @@ cp_parser_class_name (cp_parser *parser,
decl = cp_parser_maybe_treat_template_as_class (decl, class_head_p); decl = cp_parser_maybe_treat_template_as_class (decl, class_head_p);
/* If this is a typename, create a TYPENAME_TYPE. */ /* 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, decl = make_typename_type (scope, decl, typename_type,
/*complain=*/tf_error); /*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> 2019-02-01 Richard Biener <rguenther@suse.de>
PR middle-end/88597 PR middle-end/88597
......
// 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment