- case TYPE_CODE_TEMPLATE:
- /* Called on "ptype t" where "t" is a template.
- Prints the template header (with args), e.g.:
- template <class T1, class T2> class "
- and then merges with the struct/union/class code to
- print the rest of the definition. */
- c_type_print_modifier (type, stream, 0, 1);
- fprintf_filtered (stream, "template <");
- for (i = 0; i < TYPE_NTEMPLATE_ARGS (type); i++)
- {
- struct template_arg templ_arg;
- templ_arg = TYPE_TEMPLATE_ARG (type, i);
- fprintf_filtered (stream, "class %s", templ_arg.name);
- if (i < TYPE_NTEMPLATE_ARGS (type) - 1)
- fprintf_filtered (stream, ", ");
- }
- fprintf_filtered (stream, "> class ");
- /* Yuck, factor this out to a subroutine so we can call
- it and return to the point marked with the "goback:" label... - RT */
- goto struct_union;
- go_back:
- if (TYPE_NINSTANTIATIONS (type) > 0)
- {
- fprintf_filtered (stream, "\ntemplate instantiations:\n");
- for (i = 0; i < TYPE_NINSTANTIATIONS (type); i++)
- {
- fprintf_filtered (stream, " ");
- c_type_print_base (TYPE_INSTANTIATION (type, i), stream, 0, level);
- if (i < TYPE_NINSTANTIATIONS (type) - 1)
- fprintf_filtered (stream, "\n");
- }
- }