mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 12:55:40 +02:00
Bug 486618 - Name resolution problem with alias template
Change-Id: I0cf37128925fdf4a1a4fc334926efe4b81caee2f
This commit is contained in:
parent
247faec624
commit
1548dc7cf4
2 changed files with 26 additions and 1 deletions
|
@ -7226,7 +7226,27 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
public void testAliasTemplate_416280_2() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
|
||||
// struct A {
|
||||
// static constexpr bool val = true;
|
||||
// };
|
||||
//
|
||||
// struct C {
|
||||
// template <typename T>
|
||||
// using AC = A;
|
||||
// };
|
||||
//
|
||||
// template <class T>
|
||||
// struct D {
|
||||
// template <class U>
|
||||
// struct AD : T::template AC<U> {};
|
||||
// };
|
||||
//
|
||||
// bool b = D<C>::template AD<int>::val;
|
||||
public void testAliasTemplate_486618() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <typename T>
|
||||
// struct Struct {};
|
||||
//
|
||||
|
|
|
@ -2844,6 +2844,11 @@ public class CPPTemplates {
|
|||
if (unknown instanceof ICPPUnknownMemberClassInstance && result instanceof ICPPTemplateDefinition) {
|
||||
ICPPTemplateArgument[] args1 = instantiateArguments(
|
||||
((ICPPUnknownMemberClassInstance) unknown).getArguments(), tpMap, packOffset, within, point, false);
|
||||
if (result instanceof ICPPAliasTemplate) {
|
||||
IType aliasedType = ((ICPPAliasTemplate) result).getType();
|
||||
if (aliasedType instanceof IBinding)
|
||||
result = (IBinding) aliasedType;
|
||||
}
|
||||
if (result instanceof ICPPClassTemplate) {
|
||||
result = instantiate((ICPPClassTemplate) result, args1, point);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue