| 1 |
// { dg-do assemble } |
| 2 |
// Origin: Andreas Kloeckner <[email protected]> |
| 3 |
|
| 4 |
template<class Iterator> struct iterator_traits { |
| 5 |
typedef typename Iterator::iterator_category |
| 6 |
iterator_category; // { dg-error "" } no type iterator_category |
| 7 |
}; |
| 8 |
|
| 9 |
template<class Category> |
| 10 |
struct iterator { |
| 11 |
typedef Category iterator_category; |
| 12 |
}; |
| 13 |
|
| 14 |
|
| 15 |
template <class Iterator> |
| 16 |
struct reverse_iterator : public // { dg-message "required" } no type iterator_category |
| 17 |
iterator<typename iterator_traits<Iterator>::iterator_category> { |
| 18 |
protected: |
| 19 |
Iterator current; |
| 20 |
|
| 21 |
}; |
| 22 |
class tag { }; |
| 23 |
|
| 24 |
template <class T> |
| 25 |
struct list { |
| 26 |
template <class Item> |
| 27 |
struct list_iterator { |
| 28 |
}; |
| 29 |
|
| 30 |
reverse_iterator<list_iterator<T> > rbegin() |
| 31 |
{ return reverse_iterator<list_iterator<T> > |
| 32 |
(list_iterator<T>(Head->next())); } // { dg-error "" } not declared |
| 33 |
}; |
| 34 |
|
| 35 |
template class list<int>; |