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:
parent
95aa27858c
commit
cb7f0f3462
2 changed files with 15 additions and 1 deletions
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue