Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNathan Ridge2015-07-16 08:08:08 +0000
committerGerrit Code Review @ Eclipse.org2015-07-25 17:08:06 +0000
commitcb7f0f346272814987d4b76b6cf65bb474c87bf0 (patch)
tree0ef0a6116ac212e5024ca4710a4ffe7d70961b37 /core
parent95aa27858c89c7a0e0332296c736c4757d46f7a3 (diff)
downloadorg.eclipse.cdt-cb7f0f346272814987d4b76b6cf65bb474c87bf0.tar.gz
org.eclipse.cdt-cb7f0f346272814987d4b76b6cf65bb474c87bf0.tar.xz
org.eclipse.cdt-cb7f0f346272814987d4b76b6cf65bb474c87bf0.zip
Bug 472615 - Instantiate alias template found as binding for template-id
in expression Change-Id: I51aced984cfe87d4b2f2d4ebe359d65ce2845b6c Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java2
2 files changed, 15 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
index 42f4469180..440004c08b 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
@@ -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 {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
index 7db462451a..00098cb8dd 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
@@ -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 {

Back to the top