Commit 0c3251f0 by Dodji Seketeli Committed by Dodji Seketeli

PR c++/51191 - ICE on alias of alias template instantiation

gcc/cp/

	PR c++/51191
	* pt.c (primary_template_instantiation_p): Don't forget to
	consider alias declarations.

gcc/testsuite/

	PR c++/51191
	* g++.dg/cpp0x/alias-decl-13.C: New test.

From-SVN: r181475
parent 590175d2
2011-11-18 Dodji Seketeli <dodji@redhat.com>
PR c++/51191
* pt.c (primary_template_instantiation_p): Don't forget to
consider alias declarations.
2011-11-17 Jason Merrill <jason@redhat.com>
PR c++/51186
......
......@@ -2870,7 +2870,7 @@ primary_template_instantiation_p (const_tree t)
return DECL_LANG_SPECIFIC (t)
&& DECL_TEMPLATE_INSTANTIATION (t)
&& PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t));
else if (CLASS_TYPE_P (t))
else if (CLASS_TYPE_P (t) && !TYPE_DECL_ALIAS_P (TYPE_NAME (t)))
return CLASSTYPE_TEMPLATE_INSTANTIATION (t)
&& PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t));
else if (TYPE_P (t)
......
2011-11-18 Dodji Seketeli <dodji@redhat.com>
PR c++/51191
* g++.dg/cpp0x/alias-decl-13.C: New test.
2011-11-17 Jason Merrill <jason@redhat.com>
PR c++/51186
......
// Origin PR c++/51191
// { dg-options "-std=c++0x" }
template< class T >
class ClassTemplate {};
template< class T >
struct Metafunction {
typedef T type;
};
template< class T >
using TemplateAlias = ClassTemplate< typename Metafunction<T>::type >;
using Alias = TemplateAlias<int>;
template< class T >
void f( TemplateAlias<T> );
int main()
{
Alias x;
f( x ); // { dg-error "no matching function for call to|f" }
}
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