]> git.ipfire.org Git - thirdparty/gcc.git/commit
re PR c++/50608 (cannot apply 'offsetof' to a non-constant address)
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 4 Nov 2011 21:49:49 +0000 (21:49 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 4 Nov 2011 21:49:49 +0000 (21:49 +0000)
commitff6bf6e36352809346b3bfc72ecd3bf9bb9c9e0c
tree93f9df11a91a6efa570931ffb8aa7fda85218c75
parent4da6f72ef56b8dc94909f1a9b918789e1af821b8
re PR c++/50608 (cannot apply 'offsetof' to a non-constant address)

2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>

PR c++/50608
* c-parser.c (c_parser_postfix_expression) <RID_OFFSETOF>: Adjust call
to fold_offsetof.
* c-typeck.c (build_unary_op) <ADDR_EXPR>: Call fold_offsetof_1.
c-family/
* c-common.c (c_fully_fold_internal) <ADDR_EXPR>: Call fold_offsetof_1.
(fold_offsetof_1): Make global.  Remove STOP_REF argument and adjust.
<INDIRECT_REF>: Return the argument.
<ARRAY_REF>: 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: r180988
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-parser.c
gcc/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/offsetof7.C [new file with mode: 0644]