From 97b34939eecaf75c243458fa6eb5c587a7ec1fd3 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Mon, 21 Apr 2008 03:49:52 +0000 Subject: [PATCH] New test case for bug 214017 that is still failing. --- .../tests/IndexCPPTemplateResolutionTest.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java index 8cef0f38f4f..8a692679848 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java @@ -108,6 +108,50 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa assertInstance(type, IBasicType.class); assertEquals("int", ASTTypeUtil.getType(type)); } + + // template + // class Allocator; + // + // template<> + // class Allocator { + // public: + // template + // struct rebind { + // typedef Allocator<_TpRebind> other; + // }; + // }; + // + // template + // class Allocator { + // public: + // typedef _TpAllocator& alloc_reference; + // template + // struct rebind { + // typedef Allocator<_TpRebind> other; + // }; + // }; + // + // template + // class VecBase { + // public: + // typedef typename _AllocBase::template rebind<_TpBase>::other _Tp_alloc_type; + // }; + // + // template > + // class Vec : protected VecBase<_Tp, _Alloc> { + // public: + // typedef typename VecBase<_Tp, _Alloc>::_Tp_alloc_type::alloc_reference reference; + // }; + + // void f(Vec::reference r) {} + public void _testRebindPattern_214017_3() throws Exception { + IBinding b0= getBindingFromASTName("r)", 1); + assertInstance(b0, ICPPVariable.class); + IType type = ((ICPPVariable) b0).getType(); + type = SemanticUtil.getUltimateType(type, false); + assertInstance(type, IBasicType.class); + assertEquals("int", ASTTypeUtil.getType(type)); + } } public static class ProjectWithDepProj extends IndexCPPTemplateResolutionTest {