diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 21cf5a909f9..c1c04e797f7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1999-04-08 Mark Mitchell + * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands + don't have types. + * search.c (template_self_reference_p): Tweak. 1999-04-07 Mark Mitchell diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 45b96d7ef40..055f92accb0 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1564,6 +1564,7 @@ dump_expr (t, nop) else { if (TREE_OPERAND (t,0) != NULL_TREE + && TREE_TYPE (TREE_OPERAND (t, 0)) && NEXT_CODE (TREE_OPERAND (t, 0)) == REFERENCE_TYPE) dump_expr (TREE_OPERAND (t, 0), nop); else diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash35.C b/gcc/testsuite/g++.old-deja/g++.pt/crash35.C new file mode 100644 index 00000000000..d4084fea2fb --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash35.C @@ -0,0 +1,11 @@ +// Build don't link: +// Origin: Miniussi + +template +struct Str { + Str(int& val= (*new int())); +}; + +template +Str::Str(int& val) {} +