re PR c++/4934 (Seg fault on legal code)

PR c++/4934
        * error.c (dump_expr) [CONVERT_EXPR]: Make sure TREE_TYPE (t) is
        set before checking it.

From-SVN: r51972
This commit is contained in:
Jason Merrill 2002-04-06 17:22:00 -05:00 committed by Jason Merrill
parent f1526122aa
commit 03da52864c
3 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2002-04-06 Jason Merrill <jason@redhat.com>
PR c++/4934
* error.c (dump_expr) [CONVERT_EXPR]: Make sure TREE_TYPE (t) is
set before checking it.
PR c++/525
* init.c (build_member_call): Use build_scoped_ref.
(resolve_offset_ref): Likewise.

View File

@ -1729,7 +1729,7 @@ dump_expr (t, flags)
break;
case CONVERT_EXPR:
if (VOID_TYPE_P (TREE_TYPE (t)))
if (TREE_TYPE (t) && VOID_TYPE_P (TREE_TYPE (t)))
{
print_left_paren (scratch_buffer);
dump_type (TREE_TYPE (t), flags);

View File

@ -0,0 +1,5 @@
// PR c++/4934
// dump_expr didn't know how to deal with a CONVERT_EXPR with no type.
template<unsigned> struct A {};
template<typename T> struct B { A<sizeof(+int())> a; };