summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/crash36.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/crash36.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash36.C35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash36.C b/gcc/testsuite/g++.old-deja/g++.pt/crash36.C
new file mode 100644
index 000000000..fa9401bee
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash36.C
@@ -0,0 +1,35 @@
+// { dg-do assemble }
+// Origin: Andreas Kloeckner <ak@ixion.net>
+
+template<class Iterator> struct iterator_traits {
+ typedef typename Iterator::iterator_category
+ iterator_category; // { dg-error "" } no type iterator_category
+};
+
+template<class Category>
+struct iterator {
+ typedef Category iterator_category;
+};
+
+
+template <class Iterator>
+struct reverse_iterator : public // { dg-message "instantiated" } no type iterator_category
+iterator<typename iterator_traits<Iterator>::iterator_category> {
+ protected:
+ Iterator current;
+
+};
+class tag { };
+
+template <class T>
+struct list {
+ template <class Item>
+ struct list_iterator {
+ };
+
+ reverse_iterator<list_iterator<T> > rbegin()
+ { return reverse_iterator<list_iterator<T> >
+ (list_iterator<T>(Head->next())); } // { dg-error "" } not declared
+};
+
+template class list<int>;