gcc/testsuite/g++.old-deja/g++.pt/memclass4.C
raw| 1 | // { dg-do run } |
| 2 | #include <typeinfo> |
| 3 | |
| 4 | template <class T> |
| 5 | struct allocator { |
| 6 | typedef T* pointer; |
| 7 | |
| 8 | template <class U> struct rebind { |
| 9 | typedef allocator<U> other; |
| 10 | }; |
| 11 | }; |
| 12 | |
| 13 | template <class T, class Allocator> |
| 14 | struct alloc_traits |
| 15 | { |
| 16 | typedef typename Allocator::template rebind<T>::other allocator_type; |
| 17 | }; |
| 18 | |
| 19 | int main () |
| 20 | { |
| 21 | typedef alloc_traits<int, allocator<void> >::allocator_type at; |
| 22 | |
| 23 | return typeid (at) != typeid (allocator <int>); |
| 24 | } |