From a3c171f7e4844361047bf7ddc5e7d4284d71e0c9 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sun, 26 Jul 2009 23:06:53 +0000 Subject: [PATCH] Test case for bug 284686. --- .../tests/IndexCPPTemplateResolutionTest.java | 72 ++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) 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 9378641687a..4ebaf59b3f2 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 @@ -1596,7 +1596,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa public void testDefaultTemplateArgInHeader_264988() throws Exception { ICPPTemplateInstance ti= getBindingFromASTName("XT<>", 4, ICPPTemplateInstance.class); } - + // typedef int TInt; // template class XT { // void m(); @@ -1608,4 +1608,74 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa public void testParentScopeOfSpecialization_267013() throws Exception { ITypedef ti= getBindingFromASTName("TInt", 4, ITypedef.class); } + + // struct __true_type {}; + // struct __false_type {}; + // + // template + // struct __are_same { + // enum { __value = 0 }; + // typedef __false_type __type; + // }; + // + // template + // struct __are_same<_Tp, _Tp> { + // enum { __value = 1 }; + // typedef __true_type __type; + // }; + // + // template + // struct __enable_if {}; + // + // template + // struct __enable_if { + // typedef _Tp __type; + // }; + // + // template + // struct __normal_iterator { + // template + // __normal_iterator( + // const __normal_iterator< + // _Iter, + // typename __enable_if< + // __are_same<_Iter, typename _Container::pointer>::__value, + // _Container + // >::__type + // >& __i); + // }; + // + // template + // struct allocator { + // typedef _Tp* pointer; + // typedef const _Tp* const_pointer; + // + // template + // struct rebind + // { typedef allocator<_Tp1> other; }; + // }; + // + // template > + // struct vector { + // typedef vector<_Tp, _Alloc> vector_type; + // typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type; + // + // typedef typename _Tp_alloc_type::pointer pointer; + // typedef typename _Tp_alloc_type::const_pointer const_pointer; + // typedef __normal_iterator iterator; + // typedef __normal_iterator const_iterator; + // + // iterator begin(); + // const_iterator begin() const; + // }; + + // void f(vector::const_iterator p); + // + // void test() { + // vector v; + // f(v.begin()); + // } + public void _testTemplateMetaprogramming_284686() throws Exception { + getBindingFromASTName("f(v.begin())", 1, ICPPFunction.class); + } }