1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +02:00

226231: apply fix

This commit is contained in:
Andrew Ferguson 2008-04-09 14:08:56 +00:00
parent 887a1ea83e
commit fa65eafa16
2 changed files with 36 additions and 8 deletions

View file

@ -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);
}
}

View file

@ -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;