re PR c++/44627 (ICE in dump_expr, at cp/error.c:1735)

PR c++/44627
	* error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
	the CALL_EXPR has no arguments.

	* g++.dg/diagnostic/method1.C: New test.

From-SVN: r161227
This commit is contained in:
Jakub Jelinek 2010-06-22 22:42:50 +02:00 committed by Jakub Jelinek
parent f878882bef
commit dd6f4f897e
4 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2010-06-22 Jakub Jelinek <jakub@redhat.com>
PR c++/44627
* error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
the CALL_EXPR has no arguments.
2010-06-21 Jason Merrill <jason@redhat.com>
* typeck.c (comp_except_specs): Fix ce_derived with noexcept.

View File

@ -1759,7 +1759,9 @@ dump_expr (tree t, int flags)
if (TREE_CODE (fn) == OBJ_TYPE_REF)
fn = resolve_virtual_fun_from_obj_type_ref (fn);
if (TREE_TYPE (fn) != NULL_TREE && NEXT_CODE (fn) == METHOD_TYPE)
if (TREE_TYPE (fn) != NULL_TREE
&& NEXT_CODE (fn) == METHOD_TYPE
&& call_expr_nargs (t))
{
tree ob = CALL_EXPR_ARG (t, 0);
if (TREE_CODE (ob) == ADDR_EXPR)

View File

@ -1,3 +1,8 @@
2010-06-22 Jakub Jelinek <jakub@redhat.com>
PR c++/44627
* g++.dg/diagnostic/method1.C: New test.
2010-06-22 Cary Coutant <ccoutant@google.com>
* g++.dg/debug/dwarf2/dwarf4-typedef.C: New test.

View File

@ -0,0 +1,20 @@
// PR c++/44627
// { dg-do compile }
struct A
{
A *foo ();
};
template <class T>
void
bar ()
{
A::foo ().anything; // { dg-error "request for member" }
}
void
baz ()
{
bar <int> ();
}