re PR c++/26577 (ICE in cp_expr_size with volatile and non POD)
PR c++/26577 * call.c (build_new_method_call): Force evaluation of the instance pointer, not the object. From-SVN: r115105
This commit is contained in:
parent
17a9fbc457
commit
481ac1e929
@ -1,3 +1,9 @@
|
||||
2006-06-30 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/26577
|
||||
* call.c (build_new_method_call): Force evaluation of the
|
||||
instance pointer, not the object.
|
||||
|
||||
2006-06-30 Kazu Hirata <kazu@codesourcery.com>
|
||||
|
||||
* decl2.c: Fix a comment typo.
|
||||
|
@ -5501,9 +5501,9 @@ build_new_method_call (tree instance, tree fns, tree args,
|
||||
none-the-less evaluated. */
|
||||
if (TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE
|
||||
&& !is_dummy_object (instance_ptr)
|
||||
&& TREE_SIDE_EFFECTS (instance))
|
||||
&& TREE_SIDE_EFFECTS (instance_ptr))
|
||||
call = build2 (COMPOUND_EXPR, TREE_TYPE (call),
|
||||
instance, call);
|
||||
instance_ptr, call);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
16
gcc/testsuite/g++.dg/init/volatile1.C
Normal file
16
gcc/testsuite/g++.dg/init/volatile1.C
Normal file
@ -0,0 +1,16 @@
|
||||
// PR c++/26577
|
||||
// The call to bar() was causing an inappropriate dereference of *this,
|
||||
// which led to an abort in cp_expr_size.
|
||||
|
||||
struct A
|
||||
{
|
||||
A(const A&);
|
||||
A& operator=(const A&);
|
||||
static void bar();
|
||||
void baz() volatile;
|
||||
};
|
||||
|
||||
void A::baz() volatile
|
||||
{
|
||||
bar();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user