re PR c++/70067 (internal compiler error: in strip_typedefs, at cp/tree.c:1466)

PR c++/70067

	* tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
	same type.

From-SVN: r233973
This commit is contained in:
Jason Merrill 2016-03-04 11:07:20 -05:00 committed by Jason Merrill
parent 64b23c13dc
commit b54eff8bb1
3 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-03-04 Jason Merrill <jason@redhat.com>
PR c++/70067
* tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
same type.
2016-03-03 Jason Merrill <jason@redhat.com>
* method.c (synthesized_method_walk): operator= can also be constexpr.

View File

@ -1437,6 +1437,9 @@ strip_typedefs (tree t, bool *remove_attributes)
result = make_typename_type (strip_typedefs (TYPE_CONTEXT (t),
remove_attributes),
fullname, typename_type, tf_none);
/* Handle 'typedef typename A::N N;' */
if (typedef_variant_p (result))
result = TYPE_MAIN_VARIANT (DECL_ORIGINAL_TYPE (TYPE_NAME (result)));
}
break;
case DECLTYPE_TYPE:

View File

@ -0,0 +1,11 @@
// PR c++/70067
// { dg-do compile { target c++98 } }
template <class> struct A;
template <class T> struct B { struct N { }; };
template <class T> struct D: B<T> {
typedef typename D::N N;
A<N> *a;
};
D<int> d;