diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java index 9ad29cb10f9..72652445592 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java @@ -445,21 +445,24 @@ public class AST2BaseTest extends BaseTestCase { public IBinding assertProblem(String section, int len) { IBinding binding= binding(section, len); - assertTrue("Non-ProblemBinding for name: "+section, binding instanceof IProblemBinding); + assertTrue("Non-ProblemBinding for name: " + section.substring(0, len), + binding instanceof IProblemBinding); return binding; } public IBinding assertNonProblem(String section, int len) { IBinding binding= binding(section, len); - assertTrue("ProblemBinding for name: "+section, !(binding instanceof IProblemBinding)); + assertTrue("ProblemBinding for name: " + section.substring(0, len), + !(binding instanceof IProblemBinding)); return binding; } public T assertNonProblem(String section, int len, Class type, Class... cs) { IBinding binding= binding(section, len); - assertTrue("ProblemBinding for name: "+section, !(binding instanceof IProblemBinding)); + assertTrue("ProblemBinding for name: " + section.substring(0, len), + !(binding instanceof IProblemBinding)); assertInstance(binding, type); - for(Class c : cs) { + for (Class c : cs) { assertInstance(binding, c); } return type.cast(binding); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index f1a8d751dbf..8cd2eccd2d4 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -2021,7 +2021,29 @@ public class AST2TemplateTests extends AST2BaseTest { ICPPFunction fn= bh.assertNonProblem("makeClosure(this", 11, ICPPFunction.class); } - // class A {}; + // template + // struct pair { + // typedef _T1 first_type; + // }; + // + // template + // struct map { + // typedef pair<_Key, _Tp> value_type; + // }; + // + // template + // typename _C::value_type GetPair(_C& collection, typename _C::value_type::first_type key); + // + // int main(map x) { + // GetPair(x, 1); + // } + public void _testBug229917() throws Exception { + BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true); + IBinding b0 = bh.assertNonProblem("_C::value_type GetPair", 2, IBinding.class); + ICPPFunction fn = bh.assertNonProblem("GetPair(x", 7, ICPPFunction.class); + } + + // class A {}; // // template class C { // public: