]> gcc.gnu.org Git - gcc.git/commit - gcc/c/c-typeck.c
re PR c++/50608 (cannot apply 'offsetof' to a non-constant address)
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 4 Nov 2011 21:46:07 +0000 (21:46 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 4 Nov 2011 21:46:07 +0000 (21:46 +0000)
commitcf9e9959d1a5e8c7ddb506f68017b4f9c9292b94
tree15bbae4a0d50f8d41bd44c607cad67495a7c994c
parentc62c54419cf1bcdebbe2313b509e1892b85832d0
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: r180986
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]
This page took 0.058821 seconds and 5 git commands to generate.