Commit 03b256e4 by Martin v. Löwis Committed by Martin v. Löwis

typeck.c (get_member_function_from_ptrfunc): Always consider virtuality inside member pointer.

	* typeck.c (get_member_function_from_ptrfunc): Always consider
	virtuality inside member pointer.

From-SVN: r29494
parent e9013db2
1999-09-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
* typeck.c (get_member_function_from_ptrfunc): Always consider
virtuality inside member pointer.
1999-09-17 Mark Mitchell <mark@codesourcery.com> 1999-09-17 Mark Mitchell <mark@codesourcery.com>
Turn on function-at-a-time processing. Turn on function-at-a-time processing.
......
...@@ -2821,13 +2821,13 @@ get_member_function_from_ptrfunc (instance_ptrptr, function) ...@@ -2821,13 +2821,13 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
NULL_TREE, 0)); NULL_TREE, 0));
e3 = PFN_FROM_PTRMEMFUNC (function); e3 = PFN_FROM_PTRMEMFUNC (function);
if (TYPE_SIZE (basetype) != NULL_TREE /* This used to avoid checking for virtual functions if basetype
&& ! TYPE_VIRTUAL_P (basetype)) has no virtual functions, according to an earlier ANSI draft.
/* If basetype doesn't have virtual functions, don't emit code to With the final ISO C++ rules, such an optimization is
handle that case. */ incorrect: A pointer to a derived member can be static_cast
e1 = e3; to pointer-to-base-member, as long as the dynamic object
else later has the right member. */
{
/* Promoting idx before saving it improves performance on RISC /* Promoting idx before saving it improves performance on RISC
targets. Without promoting, the first compare used targets. Without promoting, the first compare used
load-with-sign-extend, while the second used normal load then load-with-sign-extend, while the second used normal load then
...@@ -2880,7 +2880,6 @@ get_member_function_from_ptrfunc (instance_ptrptr, function) ...@@ -2880,7 +2880,6 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
if (TREE_CODE (instance_ptr) == SAVE_EXPR) if (TREE_CODE (instance_ptr) == SAVE_EXPR)
e1 = build (COMPOUND_EXPR, TREE_TYPE (e1), e1 = build (COMPOUND_EXPR, TREE_TYPE (e1),
instance_ptr, e1); instance_ptr, e1);
}
*instance_ptrptr = build (PLUS_EXPR, TREE_TYPE (instance_ptr), *instance_ptrptr = build (PLUS_EXPR, TREE_TYPE (instance_ptr),
instance_ptr, delta); instance_ptr, delta);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment