mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25: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();
|
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>
|
// template<typename U>
|
||||||
// struct A {
|
// struct A {
|
||||||
// typedef U type1;
|
// 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) {
|
if (pcheck instanceof ICPPTemplateInstance && argcheck instanceof ICPPClassType) {
|
||||||
ICPPTemplateInstance pInst = (ICPPTemplateInstance) pcheck;
|
ICPPTemplateInstance pInst = (ICPPTemplateInstance) pcheck;
|
||||||
ICPPClassTemplate pTemplate= getPrimaryTemplate(pInst);
|
ICPPClassTemplate pTemplate= getPrimaryTemplate(pInst);
|
||||||
|
@ -830,6 +833,8 @@ public class TemplateArgumentDeduction {
|
||||||
IType argumentTypeBeforeTypedefResolution = a;
|
IType argumentTypeBeforeTypedefResolution = a;
|
||||||
while (a instanceof ITypedef)
|
while (a instanceof ITypedef)
|
||||||
a = ((ITypedef) a).getType();
|
a = ((ITypedef) a).getType();
|
||||||
|
while (p instanceof ITypedef)
|
||||||
|
p = ((ITypedef) p).getType();
|
||||||
if (p instanceof IBasicType) {
|
if (p instanceof IBasicType) {
|
||||||
return p.isSameType(a);
|
return p.isSameType(a);
|
||||||
} else if (p instanceof ICPPPointerToMemberType) {
|
} else if (p instanceof ICPPPointerToMemberType) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue