* typeck.c (get_member_function_from_ptrfunc): Don't try to look
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 May 2014 17:37:57 +0000 (17:37 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 May 2014 17:37:57 +0000 (17:37 +0000)
up a virtual function in a dummy object.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210651 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/typeck.c

index b6d945f..dd183cc 100644 (file)
@@ -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
index 7420da4..b671c92 100644 (file)
@@ -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);