From 83ac816fc219db5791bdd96d69780cd7f1aa0780 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sun, 8 Feb 2009 21:01:06 +0000 Subject: [PATCH] Added a test case for a bogus conversion from a class to const int&. --- .../cdt/core/parser/tests/ast2/AST2CPPTests.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index 23681e6c6c3..3f5e5dfcb56 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -6610,6 +6610,19 @@ public class AST2CPPTests extends AST2BaseTest { final String code= getAboveComment(); parseAndCheckBindings(code); } + + // struct A {}; + // A a(); + // + // void f(const int& x); + // + // void test() { + // f(a()); + // } + public void _testBug263152_1() throws Exception { + BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true); + ba.assertProblem("f(a())", 1); + } // struct A {}; // A a(); @@ -6622,7 +6635,7 @@ public class AST2CPPTests extends AST2BaseTest { // void test(B p) { // p.m(a()); // } - public void _testBug263152() throws Exception { + public void _testBug263152_2() throws Exception { BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true); ba.assertNonProblem("m(a())", 1, ICPPMethod.class); }