Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Are these tests valid?

The following two tests seem to be invalid and pass due to bugs in conversions.

// class A {};
//
// class B {
// public:
// void foo(const A& b);  should be A* instead of A&
// };
//
// template<typename T>
// class C : public B {
// public:
// void foo(T *t) {
// B::foo(static_cast<A*>(t));
// }
// };
public void testMemberLookupThroughDeferredClassBase() throws Exception {
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
ba.assertNonProblem("foo(s", 3);
}

// class X {
// template <typename S> X(S s);
// };
//
// void test(X a);   should be X* instead of X
// void bla(int g) {
// test(new X(g));
//
public void testBug239586_ClassCast() throws Exception {
parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP);
}

If nobody objects, I'm going to fix them.

-sergey

Back to the top