1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 10:15:39 +02:00

Test case for bug 276610.

This commit is contained in:
Sergey Prigogin 2009-05-17 04:48:28 +00:00
parent 0d43fd79c5
commit 8335ff2c79

View file

@ -86,8 +86,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
} }
// template<typename _TpAllocator> // template<typename _TpAllocator>
// class Allocator { // struct Allocator {
// public:
// typedef _TpAllocator& alloc_reference; // typedef _TpAllocator& alloc_reference;
// template<typename _TpRebind> // template<typename _TpRebind>
// struct rebind { // struct rebind {
@ -96,8 +95,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// }; // };
// //
// template<typename _Tp, typename _Alloc = Allocator<_Tp> > // template<typename _Tp, typename _Alloc = Allocator<_Tp> >
// class Vec { // struct Vec {
// public:
// typedef typename _Alloc::template rebind<_Tp>::other::alloc_reference reference; // typedef typename _Alloc::template rebind<_Tp>::other::alloc_reference reference;
// }; // };
@ -112,8 +110,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
} }
// template<typename _TpAllocator> // template<typename _TpAllocator>
// class Allocator { // struct Allocator {
// public:
// typedef _TpAllocator& alloc_reference; // typedef _TpAllocator& alloc_reference;
// template<typename _TpRebind> // template<typename _TpRebind>
// struct rebind { // struct rebind {
@ -122,14 +119,12 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// }; // };
// //
// template<typename _TpBase, typename _AllocBase> // template<typename _TpBase, typename _AllocBase>
// class VecBase { // struct VecBase {
// public:
// typedef typename _AllocBase::template rebind<_TpBase>::other _Tp_alloc_type; // typedef typename _AllocBase::template rebind<_TpBase>::other _Tp_alloc_type;
// }; // };
// //
// template<typename _Tp, typename _Alloc = Allocator<_Tp> > // template<typename _Tp, typename _Alloc = Allocator<_Tp> >
// class Vec : protected VecBase<_Tp, _Alloc> { // struct Vec : public VecBase<_Tp, _Alloc> {
// public:
// typedef typename VecBase<_Tp, _Alloc>::_Tp_alloc_type::alloc_reference reference; // typedef typename VecBase<_Tp, _Alloc>::_Tp_alloc_type::alloc_reference reference;
// }; // };
@ -147,8 +142,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// class Allocator; // class Allocator;
// //
// template<> // template<>
// class Allocator<void> { // struct Allocator<void> {
// public:
// template<typename _TpRebind> // template<typename _TpRebind>
// struct rebind { // struct rebind {
// typedef Allocator<_TpRebind> other; // typedef Allocator<_TpRebind> other;
@ -156,8 +150,7 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// }; // };
// //
// template<typename _TpAllocator> // template<typename _TpAllocator>
// class Allocator { // struct Allocator {
// public:
// typedef _TpAllocator& alloc_reference; // typedef _TpAllocator& alloc_reference;
// template<typename _TpRebind> // template<typename _TpRebind>
// struct rebind { // struct rebind {
@ -166,14 +159,12 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
// }; // };
// //
// template<typename _TpBase, typename _AllocBase> // template<typename _TpBase, typename _AllocBase>
// class VecBase { // struct VecBase {
// public:
// typedef typename _AllocBase::template rebind<_TpBase>::other _Tp_alloc_type; // typedef typename _AllocBase::template rebind<_TpBase>::other _Tp_alloc_type;
// }; // };
// //
// template<typename _Tp, typename _Alloc = Allocator<_Tp> > // template<typename _Tp, typename _Alloc = Allocator<_Tp> >
// class Vec : protected VecBase<_Tp, _Alloc> { // struct Vec : public VecBase<_Tp, _Alloc> {
// public:
// typedef typename VecBase<_Tp, _Alloc>::_Tp_alloc_type::alloc_reference reference; // typedef typename VecBase<_Tp, _Alloc>::_Tp_alloc_type::alloc_reference reference;
// }; // };
@ -187,6 +178,35 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
assertEquals("int", ASTTypeUtil.getType(type)); assertEquals("int", ASTTypeUtil.getType(type));
} }
// template<typename _TpAllocator>
// struct Allocator {
// typedef _TpAllocator& alloc_reference;
// template<typename _TpRebind>
// struct rebind {
// typedef Allocator<_TpRebind> other;
// };
// };
//
// template<typename _TpBase, typename _AllocBase>
// struct VecBase {
// typedef typename _AllocBase::template rebind<_TpBase*>::other unreferenced;
// typedef typename _AllocBase::template rebind<_TpBase>::other _Tp_alloc_type;
// };
//
// template<typename _Tp, typename _Alloc = Allocator<_Tp> >
// struct Vec : public VecBase<_Tp, _Alloc> {
// typedef typename VecBase<_Tp, _Alloc>::_Tp_alloc_type::alloc_reference reference;
// };
// void f(int s);
//
// void test(Vec<int>::reference p) {
// f(p);
// }
public void _testRebindPattern_276610() throws Exception {
getBindingFromASTName("f(p)", 1, ICPPFunction.class);
}
// class Str1 { // class Str1 {
// public: // public:
// Str1(const char* s) { // Str1(const char* s) {