Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferguson2008-04-09 14:08:56 +0000
committerAndrew Ferguson2008-04-09 14:08:56 +0000
commitfa65eafa16a2e94d480a91e08f1aaf38d6bf5a39 (patch)
tree5e04d64ff97c02a16ec545b50c6b7d9f57be9ab6
parent887a1ea83e60effe5d785cc3c13a67c8a7fa6b6c (diff)
downloadorg.eclipse.cdt-fa65eafa16a2e94d480a91e08f1aaf38d6bf5a39.tar.gz
org.eclipse.cdt-fa65eafa16a2e94d480a91e08f1aaf38d6bf5a39.tar.xz
org.eclipse.cdt-fa65eafa16a2e94d480a91e08f1aaf38d6bf5a39.zip
226231: apply fix
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java32
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java12
2 files changed, 36 insertions, 8 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 f2c689e9c7f..74508718300 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
@@ -2256,7 +2256,7 @@ public class AST2TemplateTests extends AST2BaseTest {
// bar(ca);
// }
public void testBug214646() throws Exception {
- BindingAssertionHelper bh= new BindingAssertionHelper(getContents(1)[0].toString(), true);
+ BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
IBinding b0= bh.assertNonProblem("foo(a)", 3);
IBinding b1= bh.assertNonProblem("bar(ca)", 3);
@@ -2292,7 +2292,7 @@ public class AST2TemplateTests extends AST2BaseTest {
// foo(d);
// }
public void testUserDefinedConversions_224364() throws Exception {
- BindingAssertionHelper bh= new BindingAssertionHelper(getContents(1)[0].toString(), true);
+ BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
ICPPFunction fn= bh.assertNonProblem("foo(d)", 3, ICPPFunction.class);
}
@@ -2312,7 +2312,7 @@ public class AST2TemplateTests extends AST2BaseTest {
// foo(d);
// }
public void testUserDefinedConversions_224364_2() throws Exception {
- BindingAssertionHelper bh= new BindingAssertionHelper(getContents(1)[0].toString(), true);
+ BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
ICPPFunction fn= bh.assertNonProblem("foo(d)", 3, ICPPFunction.class);
}
@@ -2335,7 +2335,31 @@ public class AST2TemplateTests extends AST2BaseTest {
//
// Z z= foo(*new E<Z>());
public void testUserDefinedConversions_224364_3() throws Exception {
- BindingAssertionHelper bh= new BindingAssertionHelper(getContents(1)[0].toString(), true);
+ BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
ICPPFunction fn= bh.assertNonProblem("foo(*new", 3, ICPPFunction.class);
}
+
+ // class X {}; class B {};
+ // template<typename T>
+ // class C {
+ // public:
+ // T t;
+ // operator T() {return t;}
+ // };
+ // template<>
+ // class C<X> {
+ // public:
+ // X t;
+ // operator B() {B b; return b;}
+ // };
+ // void foo(B b) {}
+ //
+ // void refs() {
+ // C<X> cx;
+ // foo(cx);
+ // }
+ public void testUserDefinedConversions_226231() throws Exception {
+ BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
+ ICPPFunction fn= bh.assertNonProblem("foo(cx", 3, ICPPFunction.class);
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
index ffca78ec97c..3cca41cd637 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
@@ -48,7 +48,7 @@ import org.eclipse.cdt.internal.core.index.IIndexType;
*
*/
public class CPPClassSpecialization extends CPPSpecialization implements
- ICPPClassType, ICPPInternalBinding {
+ ICPPClassType {
private IScope specScope;
@@ -157,9 +157,13 @@ public class CPPClassSpecialization extends CPPSpecialization implements
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType#getDeclaredMethods()
*/
public ICPPMethod[] getDeclaredMethods() throws DOMException {
- CPPClassSpecializationScope scope = (CPPClassSpecializationScope) getCompositeScope();
- if (scope.isFullyCached())
- return scope.getDeclaredMethods();
+ IScope scope= getCompositeScope();
+ if (scope instanceof CPPClassSpecializationScope) {
+ CPPClassSpecializationScope sscope= (CPPClassSpecializationScope) scope;
+ if (sscope.isFullyCached())
+ return sscope.getDeclaredMethods();
+ }
+
IBinding binding = null;
ICPPMethod [] result = null;

Back to the top