1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-18 13:45:45 +02:00

Bug 416280 - Name resolution problem with alias template.

This commit is contained in:
Sergey Prigogin 2013-09-04 14:39:47 -07:00
parent 4e81f0fce2
commit 22078c723d
2 changed files with 21 additions and 0 deletions

View file

@ -7082,6 +7082,22 @@ public class AST2TemplateTests extends AST2TestBase {
parseAndCheckBindings();
}
// template<typename T>
// struct A {};
//
// template<typename T>
// using B = A<T>;
//
// template<typename T>
// void f(B<T>* p);
//
// void test(A<int>* c) {
// f(c);
// }
public void testAliasTemplate_416280() throws Exception {
parseAndCheckBindings();
}
// template<typename U>
// struct A {
// typedef U type1;

View file

@ -292,6 +292,9 @@ public class TemplateArgumentDeduction {
}
}
}
while (pcheck instanceof ITypedef)
pcheck = ((ITypedef) pcheck).getType();
if (pcheck instanceof ICPPTemplateInstance && argcheck instanceof ICPPClassType) {
ICPPTemplateInstance pInst = (ICPPTemplateInstance) pcheck;
ICPPClassTemplate pTemplate= getPrimaryTemplate(pInst);
@ -830,6 +833,8 @@ public class TemplateArgumentDeduction {
IType argumentTypeBeforeTypedefResolution = a;
while (a instanceof ITypedef)
a = ((ITypedef) a).getType();
while (p instanceof ITypedef)
p = ((ITypedef) p).getType();
if (p instanceof IBasicType) {
return p.isSameType(a);
} else if (p instanceof ICPPPointerToMemberType) {