re PR c/67882 (surprising offsetof result on an invalid array member without diagnostic)
authorMartin Sebor <msebor@gcc.gnu.org>
Tue, 3 Nov 2015 18:53:19 +0000 (11:53 -0700)
committerMartin Sebor <msebor@gcc.gnu.org>
Tue, 3 Nov 2015 18:53:19 +0000 (11:53 -0700)
commitc85158dec62c8293382c1d311dd6e71dcbf08e32
tree401facc539421f9aa5dc9e0dcaff8a9691d3412e
parentaa3d33850faf4de0a1a2b142cefa35326a0d5c0b
re PR c/67882 (surprising offsetof result on an invalid array member without diagnostic)

PR c++-common/67882

* c-family/c-common.h (fold_offsetof_1): Add argument.
* c-family/c-common.c (fold_offsetof_1): Diagnose more invalid
offsetof expressions that reference elements past the end of
an array.

        * c-c++-common/builtin-offsetof-2.c: New test.

From-SVN: r229717
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/builtin-offsetof-2.c [new file with mode: 0644]