From cf9e9959d1a5e8c7ddb506f68017b4f9c9292b94 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 4 Nov 2011 21:46:07 +0000 Subject: re PR c++/50608 (cannot apply 'offsetof' to a non-constant address) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2011-11-04 Eric Botcazou PR c++/50608 * c-parser.c (c_parser_postfix_expression) : Adjust call to fold_offsetof. * c-typeck.c (build_unary_op) : Call fold_offsetof_1. c-family/ * c-common.c (c_fully_fold_internal) : Call fold_offsetof_1. (fold_offsetof_1): Make global.  Remove STOP_REF argument and adjust. : Return the argument. : Remove special code for negative offset. Call fold_build_pointer_plus instead of size_binop. (fold_offsetof): Remove STOP_REF argument and adjust. * c-common.h (fold_offsetof_1): Declare. (fold_offsetof): Remove STOP_REF argument. cp/ * semantics.c (finish_offsetof): Adjust call to fold_offsetof. * typeck.c (cp_build_addr_expr_1): Call fold_offsetof_1. From-SVN: r180986 --- gcc/cp/semantics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cp/semantics.c') diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index a80aec6..cebb7df 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3568,7 +3568,7 @@ finish_offsetof (tree expr) if (!complete_type_or_else (TREE_TYPE (object), object)) return error_mark_node; } - return fold_offsetof (expr, NULL_TREE); + return fold_offsetof (expr); } /* Replace the AGGR_INIT_EXPR at *TP with an equivalent CALL_EXPR. This -- cgit v1.1