mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Failing test cases for bugs 250582 and 250583.
This commit is contained in:
parent
37c141ceab
commit
498e23827e
2 changed files with 37 additions and 5 deletions
|
@ -121,10 +121,8 @@ import org.eclipse.cdt.internal.core.parser.ParserException;
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AST2CPPTests extends AST2BaseTest {
|
public class AST2CPPTests extends AST2BaseTest {
|
||||||
|
|
||||||
|
|
||||||
public AST2CPPTests() {
|
public AST2CPPTests() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6120,4 +6118,38 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
assertEquals(1, ors.length);
|
assertEquals(1, ors.length);
|
||||||
assertSame(ors[0], m1);
|
assertSame(ors[0], m1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void f(...);
|
||||||
|
//
|
||||||
|
// void test(int* p) {
|
||||||
|
// f(p);
|
||||||
|
// }
|
||||||
|
public void _testVariadicFunction_2500582() throws Exception {
|
||||||
|
final String comment= getAboveComment();
|
||||||
|
final boolean[] isCpps= {false, true};
|
||||||
|
for (boolean isCpp : isCpps) {
|
||||||
|
BindingAssertionHelper ba= new BindingAssertionHelper(comment, isCpp);
|
||||||
|
ba.assertNonProblem("f(p)", 1, IFunction.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// struct Incomplete;
|
||||||
|
//
|
||||||
|
// void f(Incomplete* p);
|
||||||
|
// void f(...);
|
||||||
|
//
|
||||||
|
// void test() {
|
||||||
|
// // Should resolve to f(Incomplete*) since 0 can be converted to Incomplete*
|
||||||
|
// f(0);
|
||||||
|
// }
|
||||||
|
public void _testVariadicFunction_2500583() throws Exception {
|
||||||
|
final String comment= getAboveComment();
|
||||||
|
final boolean[] isCpps= {false, true};
|
||||||
|
for (boolean isCpp : isCpps) {
|
||||||
|
BindingAssertionHelper ba= new BindingAssertionHelper(comment, isCpp);
|
||||||
|
IFunction decl= ba.assertNonProblem("f(Incomplete* p)", 1, IFunction.class);
|
||||||
|
IFunction func= ba.assertNonProblem("f(0)", 1, IFunction.class);
|
||||||
|
assertSame(decl, func);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4931,7 +4931,7 @@ public class AST2Tests extends AST2BaseTest {
|
||||||
assertEquals(2, tu.getDeclarationsInAST(binding).length);
|
assertEquals(2, tu.getDeclarationsInAST(binding).length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// void f() {
|
// void f() {
|
||||||
// int a,b;
|
// int a,b;
|
||||||
// { b; a; int a; }
|
// { b; a; int a; }
|
||||||
|
@ -4940,7 +4940,7 @@ public class AST2Tests extends AST2BaseTest {
|
||||||
final String comment= getAboveComment();
|
final String comment= getAboveComment();
|
||||||
final boolean[] isCpps= {false, true};
|
final boolean[] isCpps= {false, true};
|
||||||
for (boolean isCpp : isCpps) {
|
for (boolean isCpp : isCpps) {
|
||||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), isCpp);
|
BindingAssertionHelper ba= new BindingAssertionHelper(comment, isCpp);
|
||||||
|
|
||||||
ba.assertNonProblem("b; a", 1, IVariable.class); // fill cache of inner block
|
ba.assertNonProblem("b; a", 1, IVariable.class); // fill cache of inner block
|
||||||
IVariable v3= ba.assertNonProblem("a; }", 1, IVariable.class);
|
IVariable v3= ba.assertNonProblem("a; }", 1, IVariable.class);
|
||||||
|
@ -4956,7 +4956,7 @@ public class AST2Tests extends AST2BaseTest {
|
||||||
final String comment= getAboveComment();
|
final String comment= getAboveComment();
|
||||||
final boolean[] isCpps= {false, true};
|
final boolean[] isCpps= {false, true};
|
||||||
for (boolean isCpp : isCpps) {
|
for (boolean isCpp : isCpps) {
|
||||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), isCpp);
|
BindingAssertionHelper ba= new BindingAssertionHelper(comment, isCpp);
|
||||||
IParameter p= ba.assertNonProblem("ptr", 3, IParameter.class);
|
IParameter p= ba.assertNonProblem("ptr", 3, IParameter.class);
|
||||||
assertEquals("ptr", p.getName());
|
assertEquals("ptr", p.getName());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue