diff options
author | Jason Merrill <jason@redhat.com> | 2014-05-20 13:37:57 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-05-20 13:37:57 -0400 |
commit | f98732327cfaa9a50d292553f36417b46dc835b8 (patch) | |
tree | 7d2012e4c44832ffa223ea3e002005d27a4999b3 | |
parent | a852a67c020e0c07e12f1bb09d68553103eee387 (diff) | |
download | gcc-f98732327cfaa9a50d292553f36417b46dc835b8.zip gcc-f98732327cfaa9a50d292553f36417b46dc835b8.tar.gz gcc-f98732327cfaa9a50d292553f36417b46dc835b8.tar.bz2 |
typeck.c (get_member_function_from_ptrfunc): Don't try to look up a virtual function in a dummy object.
* typeck.c (get_member_function_from_ptrfunc): Don't try to look
up a virtual function in a dummy object.
From-SVN: r210651
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b6d945f..dd183cc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-05-20 Jason Merrill <jason@redhat.com> + + * typeck.c (get_member_function_from_ptrfunc): Don't try to look + up a virtual function in a dummy object. + 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/60373 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 7420da4..b671c92 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3253,6 +3253,12 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function, && !TYPE_POLYMORPHIC_P (basetype) && resolves_to_fixed_type_p (instance_ptr, 0)); + /* If we don't really have an object (i.e. in an ill-formed + conversion from PMF to pointer), we can't resolve virtual + functions anyway. */ + if (!nonvirtual && is_dummy_object (instance_ptr)) + nonvirtual = true; + if (TREE_SIDE_EFFECTS (instance_ptr)) instance_ptr = instance_save_expr = save_expr (instance_ptr); |