error.c (interesting_scope_p): New fn.

* error.c (interesting_scope_p): New fn.
	(dump_simple_decl): Use it.
	(dump_expr, case CONSTRUCTOR): Force a & for a PMF.
	(dump_expr, case OFFSET_REF): Print ->* if appropriate.

From-SVN: r24372
This commit is contained in:
Jason Merrill 1998-12-18 11:26:57 +00:00 committed by Jason Merrill
parent 0197d76bfa
commit bbcec10538
2 changed files with 33 additions and 4 deletions

View File

@ -1,3 +1,10 @@
1998-12-17 Jason Merrill <jason@yorick.cygnus.com>
* error.c (interesting_scope_p): New fn.
(dump_simple_decl): Use it.
(dump_expr, case CONSTRUCTOR): Force a & for a PMF.
(dump_expr, case OFFSET_REF): Print ->* if appropriate.
1998-12-16 Mark Mitchell <mark@markmitchell.com> 1998-12-16 Mark Mitchell <mark@markmitchell.com>
* class.c (resolve_address_of_overloaded_function): Do conversion * class.c (resolve_address_of_overloaded_function): Do conversion

View File

@ -114,6 +114,20 @@ init_error ()
scratch_firstobj = (char *)obstack_alloc (&scratch_obstack, 0); scratch_firstobj = (char *)obstack_alloc (&scratch_obstack, 0);
} }
/* Returns nonzero if SCOPE is something we want to print for random decls. */
static int
interesting_scope_p (scope)
tree scope;
{
if (scope == NULL_TREE
|| scope == global_namespace)
return 0;
return (TREE_CODE (scope) == NAMESPACE_DECL
|| AGGREGATE_TYPE_P (scope));
}
static void static void
dump_qualifiers (t, p) dump_qualifiers (t, p)
tree t; tree t;
@ -679,7 +693,7 @@ dump_simple_decl (t, type, v)
dump_type_prefix (type, v, 0); dump_type_prefix (type, v, 0);
OB_PUTC (' '); OB_PUTC (' ');
} }
if (CP_DECL_CONTEXT (t) != global_namespace) if (interesting_scope_p (DECL_CONTEXT (t)))
{ {
dump_decl (DECL_CONTEXT (t), 0); dump_decl (DECL_CONTEXT (t), 0);
OB_PUTC2 (':',':'); OB_PUTC2 (':',':');
@ -1559,7 +1573,7 @@ dump_expr (t, nop)
if (integer_all_onesp (idx)) if (integer_all_onesp (idx))
{ {
tree pfn = PFN_FROM_PTRMEMFUNC (t); tree pfn = PFN_FROM_PTRMEMFUNC (t);
dump_expr (pfn, 0); dump_unary_op ("&", pfn, 0);
break; break;
} }
if (TREE_CODE (idx) == INTEGER_CST if (TREE_CODE (idx) == INTEGER_CST
@ -1608,8 +1622,16 @@ dump_expr (t, nop)
} }
else else
{ {
dump_expr (TREE_OPERAND (t, 0), 0); if (TREE_CODE (ob) == INDIRECT_REF)
{
dump_expr (TREE_OPERAND (ob, 0), 0);
OB_PUTS (" ->* ");
}
else
{
dump_expr (ob, 0);
OB_PUTS (" .* "); OB_PUTS (" .* ");
}
dump_expr (TREE_OPERAND (t, 1), 0); dump_expr (TREE_OPERAND (t, 1), 0);
} }
break; break;