This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38699] [4.2/4.3/4.4 regression] ICE using offsetof with array
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jan 2009 20:06:49 -0000
- Subject: [Bug c++/38699] [4.2/4.3/4.4 regression] ICE using offsetof with array
- References: <bug-38699-1771@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pinskia at gcc dot gnu dot org 2009-01-02 20:06 -------
Here is a testcase which ICEs with both the C and C++ front-end and is not
rejected by either of them:
struct A
{
const char* p;
};
void foo()
{
__builtin_offsetof(struct A, p[1]);
}
--- CUT ---
This is invalid code as p[1] is not a member of struct A, only p is a member.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords|ice-on-valid-code |ice-on-invalid-code
Last reconfirmed|0000-00-00 00:00:00 |2009-01-02 20:06:49
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38699