+1999-04-09 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (make_typename_type): Complain if we don't find a type
+ when trying to make a typename type for a non-template type.
+
1999-04-09 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (start_decl): Pass attributes to grokdeclarator.
return TREE_TYPE (t);
}
}
+
+ /* If the CONTEXT is not a template type, then either the field is
+ there now or its never going to be. */
+ if (!uses_template_parms (context) && !t)
+ {
+ cp_error ("no type named `%#T' in `%#T'", name, context);
+ return error_mark_node;
+ }
+
return build_typename_type (context, name, fullname, NULL_TREE);
}
--- /dev/null
+// Build don't link:
+// Origin: Andreas Kloeckner <ak@ixion.net>
+
+template<class Iterator> struct iterator_traits {
+ typedef typename Iterator::iterator_category
+ iterator_category; // ERROR - no type iterator_category
+};
+
+template<class Category>
+struct iterator {
+ typedef Category iterator_category;
+};
+
+
+template <class Iterator>
+struct reverse_iterator : public
+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> > // ERROR - no type
+ (list_iterator<T>(Head->next())); } // ERROR - instantiated here
+};
+
+template class list<int>; // ERROR - instantiated from here