mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +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
|
@ -7227,6 +7227,20 @@ public class AST2TemplateTests extends AST2TestBase {
|
||||||
parseAndCheckBindings();
|
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>
|
// template<typename U>
|
||||||
// struct A {
|
// struct A {
|
||||||
// typedef U type1;
|
// typedef U type1;
|
||||||
|
|
|
@ -667,7 +667,7 @@ public class CPPTemplates {
|
||||||
// Functions are instantiated as part of the resolution process.
|
// Functions are instantiated as part of the resolution process.
|
||||||
IBinding result= CPPVisitor.createBinding(id);
|
IBinding result= CPPVisitor.createBinding(id);
|
||||||
IASTName templateName = id.getTemplateName();
|
IASTName templateName = id.getTemplateName();
|
||||||
if (result instanceof ICPPClassTemplate) {
|
if (result instanceof ICPPClassTemplate || result instanceof ICPPAliasTemplate) {
|
||||||
templateName.setBinding(result);
|
templateName.setBinding(result);
|
||||||
id.setBinding(null);
|
id.setBinding(null);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue