mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 08:45:44 +02:00
Bug 484200 - Point of declaration of an alias or alias template
Change-Id: I068b5fd4cf7ae4458e515a5c26265f30abaf9ad8 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
parent
393d36fc3e
commit
6c750f9289
2 changed files with 18 additions and 0 deletions
|
@ -11751,4 +11751,17 @@ public class AST2CPPTests extends AST2TestBase {
|
||||||
assertEquals(1, implicitNames.length);
|
assertEquals(1, implicitNames.length);
|
||||||
assertEquals(ctor, implicitNames[0].resolveBinding());
|
assertEquals(ctor, implicitNames[0].resolveBinding());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <typename T>
|
||||||
|
// struct Waldo {
|
||||||
|
// T x;
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// void test() {
|
||||||
|
// using Waldo = Waldo<int>;
|
||||||
|
// auto size = sizeof(Waldo::x);
|
||||||
|
// }
|
||||||
|
public void testShadowingAliasDeclaration_484200() throws Exception {
|
||||||
|
parseAndCheckBindings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1967,6 +1967,11 @@ public class CPPSemantics {
|
||||||
} else if (prop == ICPPASTNamespaceAlias.ALIAS_NAME) {
|
} else if (prop == ICPPASTNamespaceAlias.ALIAS_NAME) {
|
||||||
nd = (ASTNode) nd.getParent();
|
nd = (ASTNode) nd.getParent();
|
||||||
pointOfDecl = nd.getOffset() + nd.getLength();
|
pointOfDecl = nd.getOffset() + nd.getLength();
|
||||||
|
} else if (prop == ICPPASTAliasDeclaration.ALIAS_NAME) {
|
||||||
|
// [basic.scope.pdecl]/p3: The point of declaration of an alias or alias template
|
||||||
|
// immediately follows the type-id to which the alias refers.
|
||||||
|
ASTNode targetType = (ASTNode) ((ICPPASTAliasDeclaration) nd.getParent()).getMappingTypeId();
|
||||||
|
pointOfDecl = targetType.getOffset() + targetType.getLength();
|
||||||
} else if (prop == ICPPASTSimpleTypeTemplateParameter.PARAMETER_NAME
|
} else if (prop == ICPPASTSimpleTypeTemplateParameter.PARAMETER_NAME
|
||||||
|| prop == ICPPASTTemplatedTypeTemplateParameter.PARAMETER_NAME) {
|
|| prop == ICPPASTTemplatedTypeTemplateParameter.PARAMETER_NAME) {
|
||||||
// [basic.scope.pdecl]/p9: The point of declaration for a template parameter
|
// [basic.scope.pdecl]/p9: The point of declaration for a template parameter
|
||||||
|
|
Loading…
Add table
Reference in a new issue