mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-18 07:50:27 +08:00
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:
parent
f878882bef
commit
dd6f4f897e
@ -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.
|
||||
|
@ -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)
|
||||
|
@ -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.
|
||||
|
20
gcc/testsuite/g++.dg/diagnostic/method1.C
Normal file
20
gcc/testsuite/g++.dg/diagnostic/method1.C
Normal 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> ();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user