Commit 90471a3d by Jason Merrill Committed by Jason Merrill

PR c++/77339 - ICE with invalid use of alias template.

	* pt.c (lookup_template_class_1): Don't try to enter the scope of an
	alias template.

From-SVN: r246462
parent c8b1fbc1
2017-03-24 Jason Merrill <jason@redhat.com>
PR c++/77339 - ICE with invalid use of alias template.
* pt.c (lookup_template_class_1): Don't try to enter the scope of an
alias template.
2017-03-24 Marek Polacek <polacek@redhat.com> 2017-03-24 Marek Polacek <polacek@redhat.com>
PR c++/80119 PR c++/80119
......
...@@ -8682,9 +8682,9 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context, ...@@ -8682,9 +8682,9 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
|| !PRIMARY_TEMPLATE_P (gen_tmpl) || !PRIMARY_TEMPLATE_P (gen_tmpl)
|| currently_open_class (template_type)) || currently_open_class (template_type))
{ {
tree tinfo = TYPE_TEMPLATE_INFO_MAYBE_ALIAS (template_type); tree tinfo = TYPE_TEMPLATE_INFO (template_type);
if (comp_template_args (TI_ARGS (tinfo), arglist)) if (tinfo && comp_template_args (TI_ARGS (tinfo), arglist))
return template_type; return template_type;
} }
......
// PR c++/77339
// { dg-do compile { target c++11 } }
template < typename > using A = int;
//OK: template < typename X > A < X > a;
template < typename X > A < X >::a; // { dg-error "" }
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