Commit 3a3173c9 by Dodji Seketeli Committed by Dodji Seketeli

re PR c++/42069 (ICE on class template specialization)

Fix PR c++/42069

gcc/cp/ChangeLog:
	PR c++/42069
	* pt.c (convert_template_argument): Strip typedefs from SCOPE_REFs.

gcc/testsuite/ChangeLog:
	PR c++/42069
	* g++.dg/template/typedef23.C: New test.

From-SVN: r154768
parent 92a745f3
2009-11-30 Dodji Seketeli <dodji@redhat.com>
PR c++/42069
* pt.c (convert_template_argument): Strip typedefs from SCOPE_REFs.
2009-11-29 Dodji Seketeli <dodji@redhat.com>
PR c++/36408
......
......@@ -5526,6 +5526,13 @@ convert_template_argument (tree parm,
if (TYPE_P (val))
val = strip_typedefs (val);
}
else if (TREE_CODE (orig_arg) == SCOPE_REF)
{
/* Strip typedefs from the SCOPE_REF. */
tree type = strip_typedefs (TREE_TYPE (orig_arg));
tree scope = strip_typedefs (TREE_OPERAND (orig_arg, 0));
val = build2 (SCOPE_REF, type, scope, TREE_OPERAND (orig_arg, 1));
}
else
{
tree t = tsubst (TREE_TYPE (parm), args, complain, in_decl);
......
2009-11-30 Dodji Seketeli <dodji@redhat.com>
PR c++/42069
* g++.dg/template/typedef23.C: New test.
2009-11-29 H.J. Lu <hongjiu.lu@intel.com>
PR tree-optimization/41961
......
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/42069
// { dg-do compile }
struct A
{
static const int N = 0;
};
template<int> struct B {};
template<typename T, int>
struct C
{
typedef T U;
B<U::N> b;
};
template<typename T>
struct C<T*, 0>
{
B<T::N> b;
};
C<A*, 0> c;
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