mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 395026 - Name resolution problem with an alias template.
This commit is contained in:
parent
dfd1d0d635
commit
469b2e8b58
2 changed files with 49 additions and 0 deletions
|
@ -6684,4 +6684,49 @@ public class AST2TemplateTests extends AST2BaseTest {
|
|||
|
||||
assertTrue(AliasInt.getScope() instanceof ICPPTemplateScope);
|
||||
}
|
||||
|
||||
// template<typename U>
|
||||
// struct A {
|
||||
// template<typename V>
|
||||
// struct rebind {
|
||||
// typedef A<V> other;
|
||||
// };
|
||||
// };
|
||||
//
|
||||
// template<typename T, typename U>
|
||||
// struct B {
|
||||
// typedef typename T::template rebind<U>::other type1;
|
||||
// };
|
||||
//
|
||||
// template<typename T>
|
||||
// struct C {
|
||||
// template<typename U>
|
||||
// using rebind2 = typename B<T, U>::type1;
|
||||
// };
|
||||
//
|
||||
// template<typename T>
|
||||
// struct D : C<T> {
|
||||
// typedef int type0;
|
||||
//
|
||||
// template<typename U>
|
||||
// struct rebind {
|
||||
// typedef typename C<T>::template rebind2<U> other2;
|
||||
// };
|
||||
// };
|
||||
//
|
||||
// template<typename T>
|
||||
// struct E {
|
||||
// typedef typename D<T>::template rebind<int>::other2 type2;
|
||||
// typedef D<type2> type3;
|
||||
// typedef typename type3::type0 type;
|
||||
// };
|
||||
//
|
||||
// void f(int x);
|
||||
//
|
||||
// void test(E<A<int>>::type v) {
|
||||
// f(v);
|
||||
// }
|
||||
public void testAliasTemplate_395026() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -827,6 +827,10 @@ public class CPPTemplates {
|
|||
} else if (decl instanceof ITypedef) {
|
||||
IType type= instantiateType(((ITypedef) decl).getType(), tpMap, -1, getSpecializationContext(owner), point);
|
||||
spec = new CPPTypedefSpecialization(decl, owner, tpMap, type);
|
||||
} else if (decl instanceof ICPPAliasTemplate) {
|
||||
ICPPAliasTemplate aliasTemplate = (ICPPAliasTemplate) decl;
|
||||
IType type= instantiateType(aliasTemplate.getType(), tpMap, -1, getSpecializationContext(owner), point);
|
||||
spec = new CPPAliasTemplateInstance(decl.getNameCharArray(), type, aliasTemplate);
|
||||
} else if (decl instanceof IEnumeration || decl instanceof IEnumerator) {
|
||||
// TODO(sprigogin): Deal with a case when an enumerator value depends on a template parameter.
|
||||
spec = decl;
|
||||
|
|
Loading…
Add table
Reference in a new issue