decl.c (duplicate_decls): Fix check for when it's safe to free the new decl.
* decl.c (duplicate_decls): Fix check for when it's safe to free the new decl. * pt.c (mangle_class_name_for_template): Don't pass a typedef type to type_as_string. From Mark Mitchell: (unify): Use comptypes to compare type args. From-SVN: r19252
This commit is contained in:
parent
e009aaf31f
commit
3a56f0abd3
|
@ -1,3 +1,13 @@
|
||||||
|
Fri Apr 17 00:24:22 1998 Jason Merrill <jason@yorick.cygnus.com>
|
||||||
|
|
||||||
|
* decl.c (duplicate_decls): Fix check for when it's safe to free
|
||||||
|
the new decl.
|
||||||
|
|
||||||
|
* pt.c (mangle_class_name_for_template): Don't pass a typedef type
|
||||||
|
to type_as_string.
|
||||||
|
From Mark Mitchell:
|
||||||
|
(unify): Use comptypes to compare type args.
|
||||||
|
|
||||||
Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com)
|
Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com)
|
||||||
|
|
||||||
* pt.c (build_template_parm_index): Add prototype.
|
* pt.c (build_template_parm_index): Add prototype.
|
||||||
|
|
|
@ -3088,9 +3088,12 @@ duplicate_decls (newdecl, olddecl)
|
||||||
TREE_VALUE (decls) = olddecl;
|
TREE_VALUE (decls) = olddecl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((char *)newdecl + ROUND (function_size)
|
if (((char *)newdecl + ROUND (function_size) == (char *)nl
|
||||||
+ ROUND (sizeof (struct lang_decl))
|
&& ((char *)newdecl + ROUND (function_size)
|
||||||
== obstack_next_free (&permanent_obstack))
|
+ ROUND (sizeof (struct lang_decl))
|
||||||
|
== obstack_next_free (&permanent_obstack)))
|
||||||
|
|| ((char *)newdecl + ROUND (function_size)
|
||||||
|
== obstack_next_free (&permanent_obstack)))
|
||||||
{
|
{
|
||||||
DECL_MAIN_VARIANT (newdecl) = olddecl;
|
DECL_MAIN_VARIANT (newdecl) = olddecl;
|
||||||
DECL_LANG_SPECIFIC (olddecl) = ol;
|
DECL_LANG_SPECIFIC (olddecl) = ol;
|
||||||
|
|
24
gcc/cp/pt.c
24
gcc/cp/pt.c
|
@ -2546,9 +2546,15 @@ mangle_class_name_for_template (name, parms, arglist, ctx)
|
||||||
char* s;
|
char* s;
|
||||||
|
|
||||||
if (TREE_CODE (ctx) == FUNCTION_DECL)
|
if (TREE_CODE (ctx) == FUNCTION_DECL)
|
||||||
s = fndecl_as_string(ctx, 0);
|
s = fndecl_as_string (ctx, 0);
|
||||||
else if (TREE_CODE_CLASS (TREE_CODE (ctx)) == 't')
|
else if (TREE_CODE_CLASS (TREE_CODE (ctx)) == 't')
|
||||||
s = type_as_string(ctx, 0);
|
{
|
||||||
|
/* We can't use a typedef type name here. */
|
||||||
|
ctx = build_type_variant (TYPE_MAIN_VARIANT (ctx),
|
||||||
|
TYPE_READONLY (ctx),
|
||||||
|
TYPE_VOLATILE (ctx));
|
||||||
|
s = type_as_string (ctx, 0);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
my_friendly_abort (0);
|
my_friendly_abort (0);
|
||||||
cat (s);
|
cat (s);
|
||||||
|
@ -2566,6 +2572,12 @@ mangle_class_name_for_template (name, parms, arglist, ctx)
|
||||||
if (i)
|
if (i)
|
||||||
ccat (',');
|
ccat (',');
|
||||||
|
|
||||||
|
/* We can't use a typedef type name here. */
|
||||||
|
if (TREE_CODE_CLASS (TREE_CODE (arg)) == 't')
|
||||||
|
arg = build_type_variant (TYPE_MAIN_VARIANT (arg),
|
||||||
|
TYPE_READONLY (arg),
|
||||||
|
TYPE_VOLATILE (arg));
|
||||||
|
|
||||||
if (TREE_CODE (parm) == TYPE_DECL)
|
if (TREE_CODE (parm) == TYPE_DECL)
|
||||||
{
|
{
|
||||||
cat (type_as_string (arg, 0));
|
cat (type_as_string (arg, 0));
|
||||||
|
@ -5627,7 +5639,9 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Simple cases: Value already set, does match or doesn't. */
|
/* Simple cases: Value already set, does match or doesn't. */
|
||||||
if (targ == arg || (targ && explicit_mask && explicit_mask[idx]))
|
if (targ != NULL_TREE
|
||||||
|
&& (comptypes (targ, arg, 1)
|
||||||
|
|| (explicit_mask && explicit_mask[idx])))
|
||||||
return 0;
|
return 0;
|
||||||
else if (targ)
|
else if (targ)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -5697,7 +5711,9 @@ unify (tparms, targs, ntparms, parm, arg, strict, explicit_mask)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Simple cases: Value already set, does match or doesn't. */
|
/* Simple cases: Value already set, does match or doesn't. */
|
||||||
if (targ == arg || (targ && explicit_mask && explicit_mask[idx]))
|
if (targ != NULL_TREE
|
||||||
|
&& (comptypes (targ, arg, 1)
|
||||||
|
|| (explicit_mask && explicit_mask[idx])))
|
||||||
return 0;
|
return 0;
|
||||||
else if (targ)
|
else if (targ)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue