Commit dd6f4f89 by Jakub Jelinek Committed by Jakub Jelinek

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
parent f878882b
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> 2010-06-21 Jason Merrill <jason@redhat.com>
* typeck.c (comp_except_specs): Fix ce_derived with noexcept. * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
......
...@@ -1759,7 +1759,9 @@ dump_expr (tree t, int flags) ...@@ -1759,7 +1759,9 @@ dump_expr (tree t, int flags)
if (TREE_CODE (fn) == OBJ_TYPE_REF) if (TREE_CODE (fn) == OBJ_TYPE_REF)
fn = resolve_virtual_fun_from_obj_type_ref (fn); 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); tree ob = CALL_EXPR_ARG (t, 0);
if (TREE_CODE (ob) == ADDR_EXPR) if (TREE_CODE (ob) == ADDR_EXPR)
......
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> 2010-06-22 Cary Coutant <ccoutant@google.com>
* g++.dg/debug/dwarf2/dwarf4-typedef.C: New test. * g++.dg/debug/dwarf2/dwarf4-typedef.C: New test.
......
// 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> ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment