summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-03-10 23:35:12 (EDT)
committer Sergey Prigogin2013-03-11 14:18:27 (EDT)
commit0d2decffcfbbe453c6c58fb2f9cb5c0be0082589 (patch)
treea1601d7e7ff742882232a239697d149c73c6a194
parentc8e936ae119c12ed88dbdfb6a9913aa71225d899 (diff)
downloadorg.eclipse.cdt-0d2decffcfbbe453c6c58fb2f9cb5c0be0082589.zip
org.eclipse.cdt-0d2decffcfbbe453c6c58fb2f9cb5c0be0082589.tar.gz
org.eclipse.cdt-0d2decffcfbbe453c6c58fb2f9cb5c0be0082589.tar.bz2
Bug 402861 - Error involving pointer-to-member of template classrefs/changes/34/11034/3
Change-Id: I418b5698757650f86000c31b8b7ea12e0192fcee Reviewed-on: https://git.eclipse.org/r/11034 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java15
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java2
2 files changed, 16 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 98f06da..9d6a65a 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
@@ -6212,6 +6212,21 @@ public class AST2TemplateTests extends AST2TestBase {
public void testPointerToMemberAsDependentExpression_391001() throws Exception {
parseAndCheckBindings(getAboveComment(), CPP, true);
}
+
+ // template<typename>
+ // struct A {
+ // char x;
+ // };
+ //
+ // typedef A<int> B;
+ //
+ // template <char B::*PtrToMember>
+ // struct C {};
+ //
+ // typedef C<&B::x> T;
+ public void testPointerToMemberOfTemplateClass_402861() throws Exception {
+ parseAndCheckBindings();
+ }
// class Memory { };
// Memory memory;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java
index 39b4c49..ebc6491 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java
@@ -44,7 +44,7 @@ public class CPPFieldSpecialization extends CPPSpecialization implements ICPPFie
@Override
public ICPPClassType getClassOwner() {
- return getField().getClassOwner();
+ return (ICPPClassType) getOwner();
}
@Override