--- Comment #5 from pinskia at gcc dot gnu dot org 2009-01-03 05:59 ---
Ok, I have a simpler patch to just c-common.c to error out in this case.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38699
--- Comment #4 from pinskia at gcc dot gnu dot org 2009-01-03 00:12 ---
C is so much easier because templates.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38699
--- Comment #3 from pinskia at gcc dot gnu dot org 2009-01-02 22:24 ---
I have a patch at least for the C front-end, working on the C++ front-end now.
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
--
--- 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
--- Comment #1 from jakub at gcc dot gnu dot org 2009-01-02 15:20 ---
That seems invalid, not valid.
E.g. C says that for offsetof (type, member) for
static type t;
&(t.member) evaluates to an address constant, which is not the case for
const char *p; field and p[0].
--
http://gcc.g
--
reichelt at gcc dot gnu dot org changed:
What|Removed |Added
Target Milestone|--- |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38699