aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-03-21 15:42:36 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-03-21 15:42:36 +0000
commitf3146d75a925306d35d582c3c927d06ce93aa03d (patch)
tree3e7d8b64875f583eb668a0b9ec42505d04c42847 /gcc/cp/error.c
parent526278c97fe19c97ce04c66238127097fe4da76b (diff)
downloadgcc-f3146d75a925306d35d582c3c927d06ce93aa03d.zip
gcc-f3146d75a925306d35d582c3c927d06ce93aa03d.tar.gz
gcc-f3146d75a925306d35d582c3c927d06ce93aa03d.tar.bz2
re PR c++/9898 (Template reference cast operator of template class)
cp: PR c++/9898 * error.c (dump_decl) [CONST_DECL]: Print '<enumerator>'. (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call. testsuite: PR c++/9898 * g++.dg/other/error4.C: New test. From-SVN: r64667
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 42a7ff7..e687ac0 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -971,7 +971,7 @@ dump_decl (tree t, int flags)
else if (DECL_INITIAL (t))
dump_expr (DECL_INITIAL (t), flags | TFF_EXPR_IN_PARENS);
else
- print_identifier (scratch_buffer, "enumerator");
+ print_identifier (scratch_buffer, "<enumerator>");
break;
case USING_DECL:
@@ -1844,9 +1844,19 @@ dump_expr (tree t, int flags)
}
}
}
- output_add_character (scratch_buffer, '{');
- dump_expr_list (CONSTRUCTOR_ELTS (t), flags);
- output_add_character (scratch_buffer, '}');
+ if (TREE_TYPE (t) && !CONSTRUCTOR_ELTS (t))
+ {
+ dump_type (TREE_TYPE (t), 0);
+ output_add_character (scratch_buffer, '(');
+ output_add_character (scratch_buffer, ')');
+ }
+ else
+ {
+ output_add_character (scratch_buffer, '{');
+ dump_expr_list (CONSTRUCTOR_ELTS (t), flags);
+ output_add_character (scratch_buffer, '}');
+ }
+
break;
case OFFSET_REF: