1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

178628: unit test for function template resolution failure

This commit is contained in:
Andrew Ferguson 2007-03-21 18:24:41 +00:00
parent 73588b3287
commit 8b5a8679cc

View file

@ -58,6 +58,22 @@ public abstract class IndexCPPBindingResolutionTest extends IndexBindingResoluti
suite.addTest(suite(ProjectWithDepProj.class));
}
// // header file
// template <class T>
// T left(T a, T b) {
// return a;
// }
// void sanity() {}
// void foo() { sanity(); }
// class Int {};
// Int a,b;
// Int c= left(a,b);
public void _testSimpleFunctionTemplate() {
IBinding b0 = getBindingFromASTName("sanity();", 6);
IBinding b1 = getBindingFromASTName("left(a,b)", 4);
}
// // header file
// class Base {public: int field; void foo() {}};
// class C : public Base {
@ -1054,26 +1070,6 @@ public abstract class IndexCPPBindingResolutionTest extends IndexBindingResoluti
}
}
// typedef struct S {int a;} S;
// typedef enum E {A,B} E;
// class A {
// public:
// S *s;
// E *e;
// };
public void testTypedef() {
IBinding b1 = getBindingFromASTName("S", 1);
assertTrue(b1 instanceof ICPPClassType);
IBinding b2 = getBindingFromASTName("E", 1);
assertTrue(b2 instanceof IEnumeration);
}
/* CPP assertion helpers */
/* ##################################################################### */