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:
parent
73588b3287
commit
8b5a8679cc
1 changed files with 17 additions and 21 deletions
|
@ -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 */
|
||||
/* ##################################################################### */
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue