error.c (dump_decl): Fix type default template args.
* error.c (dump_decl): Fix type default template args. (dump_type): Hand TEMPLATE_DECL off to dump_decl. From-SVN: r17470
This commit is contained in:
parent
b7a290122f
commit
67c2a92854
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Jan 24 12:13:54 1998 Jason Merrill <jason@yorick.cygnus.com>
|
||||||
|
|
||||||
|
* error.c (dump_decl): Fix type default template args.
|
||||||
|
(dump_type): Hand TEMPLATE_DECL off to dump_decl.
|
||||||
|
|
||||||
Fri Jan 23 18:34:37 1998 Mumit Khan <khan@xraylith.wisc.edu>
|
Fri Jan 23 18:34:37 1998 Mumit Khan <khan@xraylith.wisc.edu>
|
||||||
|
|
||||||
* lex.c (DIR_SEPARATOR): Define to be '/' if not already defined.
|
* lex.c (DIR_SEPARATOR): Define to be '/' if not already defined.
|
||||||
|
|
|
@ -207,6 +207,7 @@ dump_type (t, v)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_DECL:
|
case TYPE_DECL:
|
||||||
|
case TEMPLATE_DECL:
|
||||||
dump_decl (t, v);
|
dump_decl (t, v);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -229,58 +230,6 @@ dump_type (t, v)
|
||||||
OB_PUTID (TYPE_IDENTIFIER (t));
|
OB_PUTID (TYPE_IDENTIFIER (t));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* A substituted template template parameter. Default template
|
|
||||||
argument handling are different from dump_decl. */
|
|
||||||
case TEMPLATE_DECL:
|
|
||||||
{
|
|
||||||
tree orig_args = DECL_TEMPLATE_PARMS (t);
|
|
||||||
tree args;
|
|
||||||
int i;
|
|
||||||
for (args = orig_args = nreverse (orig_args);
|
|
||||||
args;
|
|
||||||
args = TREE_CHAIN (args))
|
|
||||||
{
|
|
||||||
int len = TREE_VEC_LENGTH (TREE_VALUE (args));
|
|
||||||
|
|
||||||
OB_PUTS ("template <");
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
{
|
|
||||||
tree arg = TREE_VEC_ELT (TREE_VALUE (args), i);
|
|
||||||
tree defval = TREE_PURPOSE (arg);
|
|
||||||
arg = TREE_VALUE (arg);
|
|
||||||
if (TREE_CODE (arg) == TYPE_DECL)
|
|
||||||
{
|
|
||||||
if (DECL_NAME (arg))
|
|
||||||
{
|
|
||||||
OB_PUTS ("class ");
|
|
||||||
OB_PUTID (DECL_NAME (arg));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
OB_PUTS ("class");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
dump_decl (arg, 1);
|
|
||||||
|
|
||||||
if (defval)
|
|
||||||
{
|
|
||||||
OB_PUTS (" = ");
|
|
||||||
if (TREE_CODE (arg) == TYPE_DECL)
|
|
||||||
dump_type (defval, 1);
|
|
||||||
else
|
|
||||||
dump_expr (defval, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
OB_PUTC2 (',', ' ');
|
|
||||||
}
|
|
||||||
if (len != 0)
|
|
||||||
OB_UNPUT (2);
|
|
||||||
OB_PUTC2 ('>', ' ');
|
|
||||||
}
|
|
||||||
nreverse(orig_args);
|
|
||||||
dump_type (TREE_TYPE (t), v);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TEMPLATE_TEMPLATE_PARM:
|
case TEMPLATE_TEMPLATE_PARM:
|
||||||
if (!CLASSTYPE_TEMPLATE_INFO (t))
|
if (!CLASSTYPE_TEMPLATE_INFO (t))
|
||||||
{
|
{
|
||||||
|
@ -837,7 +786,10 @@ dump_decl (t, v)
|
||||||
if (defval)
|
if (defval)
|
||||||
{
|
{
|
||||||
OB_PUTS (" = ");
|
OB_PUTS (" = ");
|
||||||
dump_decl (defval, 1);
|
if (TREE_CODE (arg) == TYPE_DECL)
|
||||||
|
dump_type (defval, 1);
|
||||||
|
else
|
||||||
|
dump_decl (defval, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
OB_PUTC2 (',', ' ');
|
OB_PUTC2 (',', ' ');
|
||||||
|
|
Loading…
Reference in New Issue