diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1998-12-18 11:26:57 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-12-18 06:26:57 -0500 |
commit | bbcec105382edc476901620cfff1e47f9b9c3e76 (patch) | |
tree | 33c224491c9b48ea7f3d62e27f8ac031d972c158 /gcc | |
parent | 0197d76bfafb3d84b4df1b80b5e01f02a9272a37 (diff) | |
download | gcc-bbcec105382edc476901620cfff1e47f9b9c3e76.zip gcc-bbcec105382edc476901620cfff1e47f9b9c3e76.tar.gz gcc-bbcec105382edc476901620cfff1e47f9b9c3e76.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/error.c | 30 |
2 files changed, 33 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3f04c56..86901b8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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> * class.c (resolve_address_of_overloaded_function): Do conversion diff --git a/gcc/cp/error.c b/gcc/cp/error.c index fba5005..d5e2877 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -114,6 +114,20 @@ init_error () 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 dump_qualifiers (t, p) tree t; @@ -679,7 +693,7 @@ dump_simple_decl (t, type, v) dump_type_prefix (type, v, 0); OB_PUTC (' '); } - if (CP_DECL_CONTEXT (t) != global_namespace) + if (interesting_scope_p (DECL_CONTEXT (t))) { dump_decl (DECL_CONTEXT (t), 0); OB_PUTC2 (':',':'); @@ -1559,7 +1573,7 @@ dump_expr (t, nop) if (integer_all_onesp (idx)) { tree pfn = PFN_FROM_PTRMEMFUNC (t); - dump_expr (pfn, 0); + dump_unary_op ("&", pfn, 0); break; } if (TREE_CODE (idx) == INTEGER_CST @@ -1608,8 +1622,16 @@ dump_expr (t, nop) } else { - dump_expr (TREE_OPERAND (t, 0), 0); - OB_PUTS (" .* "); + if (TREE_CODE (ob) == INDIRECT_REF) + { + dump_expr (TREE_OPERAND (ob, 0), 0); + OB_PUTS (" ->* "); + } + else + { + dump_expr (ob, 0); + OB_PUTS (" .* "); + } dump_expr (TREE_OPERAND (t, 1), 0); } break; |