1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 02:36:01 +02:00

Bug 472615 - Instantiate alias template found as binding for template-id

in expression

Change-Id: I51aced984cfe87d4b2f2d4ebe359d65ce2845b6c
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
Nathan Ridge 2015-07-16 04:08:08 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent 95aa27858c
commit cb7f0f3462
2 changed files with 15 additions and 1 deletions

View file

@ -7226,6 +7226,20 @@ public class AST2TemplateTests extends AST2TestBase {
public void testAliasTemplate_416280_2() throws Exception {
parseAndCheckBindings();
}
// template <typename T>
// struct Struct {};
//
// template <typename T> using Alias = Struct<T>;
//
// void waldo(Struct<int>);
//
// int main() {
// waldo(Alias<int>());
// }
public void testTemplateIdNamingAliasTemplateInExpression_472615() throws Exception {
parseAndCheckBindings();
}
// template<typename U>
// struct A {

View file

@ -667,7 +667,7 @@ public class CPPTemplates {
// Functions are instantiated as part of the resolution process.
IBinding result= CPPVisitor.createBinding(id);
IASTName templateName = id.getTemplateName();
if (result instanceof ICPPClassTemplate) {
if (result instanceof ICPPClassTemplate || result instanceof ICPPAliasTemplate) {
templateName.setBinding(result);
id.setBinding(null);
} else {