Fixes a crash in modules where the template class decl becomes the most recent
decl in the redeclaration chain and forcing the template instantiator try to
instantiate the friend declaration, rather than the template definition.
In practice, A::list<int> produces a TemplateSpecializationType
A::__1::list<int, allocator<type-parameter-0-0> >' failing to replace to
subsitute the default argument to allocator<int>.
Kudos Richard Smith (D28399).
llvm-svn: 291753
18 lines
559 B
C++
18 lines
559 B
C++
namespace A {
|
|
inline
|
|
namespace __1 {
|
|
template <class _Tp> class allocator;
|
|
template <class _Tp, class _Alloc = allocator<_Tp>> class list;
|
|
template <class _VoidPtr> class __list_iterator {
|
|
//template <class> friend class list; // causes another crash in ASTDeclReader::attachPreviousDecl
|
|
template <class, class> friend class list;
|
|
};
|
|
template <class _Tp, class _Alloc> class __list_imp {};
|
|
template <class _Tp, class _Alloc> class list : __list_imp<_Tp, _Alloc> {
|
|
public:
|
|
list() {}
|
|
};
|
|
template <class _Tp> void f(list<_Tp>);
|
|
}
|
|
}
|