Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2014-10-28 01:04:06 +0000
committerSergey Prigogin2014-10-28 01:04:06 +0000
commit078541c956325538b01d8d4561c4bc625751d375 (patch)
tree817da4a94e717162b860bb5b6f742c8483f32ca5
parente437230f580ff091d8d5f7e487cd870c2133c38b (diff)
downloadorg.eclipse.cdt-078541c956325538b01d8d4561c4bc625751d375.tar.gz
org.eclipse.cdt-078541c956325538b01d8d4561c4bc625751d375.tar.xz
org.eclipse.cdt-078541c956325538b01d8d4561c4bc625751d375.zip
Bug 448785 - Name resolution problem with nested alias template
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java25
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTemplateIDAmbiguity.java6
2 files changed, 29 insertions, 2 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 1b9dbcd3b9b..47209ec482a 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
@@ -7054,6 +7054,31 @@ public class AST2TemplateTests extends AST2TestBase {
assertSameType(tRef.getTemplateParameterMap().getArgument(0).getTypeValue(), Sint);
}
+ // template <typename T>
+ // struct A {
+ // typedef void (T::*func)();
+ // };
+ //
+ // template <typename T>
+ // struct B {
+ // template <typename A<T>::func U>
+ // class C {};
+ //
+ // template <typename A<T>::func U>
+ // using Waldo = C<U>;
+ // };
+ //
+ // struct D {
+ // void m();
+ // };
+ //
+ // void test() {
+ // B<D>::Waldo<&D::m>();
+ // }
+ public void testTemplatedAliasWithPointerToMember_448785() throws Exception {
+ parseAndCheckBindings();
+ }
+
// namespace NS {
// template<typename T>
// struct S {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTemplateIDAmbiguity.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTemplateIDAmbiguity.java
index a6352b9b34c..973c419f862 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTemplateIDAmbiguity.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTemplateIDAmbiguity.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -22,6 +23,7 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IFunction;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPAliasTemplateInstance;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
@@ -117,7 +119,7 @@ public class CPPASTTemplateIDAmbiguity extends ASTAmbiguousNode
return -1;
count++;
} else if (b instanceof ICPPSpecialization || b instanceof ICPPTemplateDefinition
- || b instanceof ICPPConstructor
+ || b instanceof ICPPAliasTemplateInstance || b instanceof ICPPConstructor
|| (b instanceof IFunction && b instanceof ICPPUnknownBinding)) {
count++;
} else {

Back to the top