mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 18:55:38 +02:00
Bug 416280 - Name resolution problem with alias template.
This commit is contained in:
parent
8f5e2ed1be
commit
364783cb62
2 changed files with 21 additions and 0 deletions
|
@ -7085,6 +7085,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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue