This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: new regression in g++.old-deja/g++.other/decl3.C
On Wed, Jul 07, 2004 at 09:38:00AM +0100, Nathan Sidwell wrote:
> && TREE_CODE (OBJ_TYPE_REF_OBJECT (callee)) == ADDR_EXPR
> && DECL_P (TREE_OPERAND (OBJ_TYPE_REF_OBJECT (callee), 0)))
> {
> tree t;
>
> t = TREE_TYPE (TREE_OPERAND (OBJ_TYPE_REF_OBJECT (callee), 0));
> t = lang_hooks.fold_obj_type_ref (callee, t); <-- here
Bah. Two choices:
/* ??? Caution: Broken ADDR_EXPR semantics means that looking at the
type of the operand of the addr_expr can yield an array type.
See silly exception in check_pointer_types_r. */
(1) t = TREE_TYPE (TREE_TYPE (OBJ_TYPE_REF_OBJECT (callee)));
(2) t = TREE_TYPE (TREE_OPERAND (OBJ_TYPE_REF_OBJECT (callee), 0));
if (TREE_CODE (t) == ARRAY_TYPE)
t = TREE_TYPE (t);
I'm not sure which I prefer here. I'm also too tired to test either
at the moment. If you could smoke-test one, I'd appreciate it.
r~