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
+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.
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)
+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.
--- /dev/null
+// 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> ();
+}