gcc/testsuite/g++.old-deja/g++.robertl/eb10.C
raw| 1 | // { dg-do assemble } |
| 2 | template <int object_size> |
| 3 | class _fixed_size_allocator |
| 4 | { |
| 5 | private: |
| 6 | |
| 7 | struct something { }; |
| 8 | static something * asdf; |
| 9 | |
| 10 | public: |
| 11 | |
| 12 | static void delete_object (); |
| 13 | }; |
| 14 | |
| 15 | |
| 16 | template <class T> |
| 17 | class object_allocator |
| 18 | { |
| 19 | private: |
| 20 | |
| 21 | typedef _fixed_size_allocator<sizeof (T)> allocator; |
| 22 | |
| 23 | public: |
| 24 | |
| 25 | static void deallocate (T * p) |
| 26 | { |
| 27 | allocator::delete_object (reinterpret_cast<void *> (p)); |
| 28 | } |
| 29 | }; |
| 30 |