[Bug c++/38699] [4.2/4.3/4.4 regression] ICE using offsetof with array

2009-01-02 Thread pinskia at gcc dot gnu dot org
--- 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

[Bug c++/38699] [4.2/4.3/4.4 regression] ICE using offsetof with array

2009-01-02 Thread pinskia at gcc dot gnu dot org
--- 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

[Bug c++/38699] [4.2/4.3/4.4 regression] ICE using offsetof with array

2009-01-02 Thread pinskia at gcc dot gnu dot org
--- 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 --

[Bug c++/38699] [4.2/4.3/4.4 regression] ICE using offsetof with array

2009-01-02 Thread pinskia 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

[Bug c++/38699] [4.2/4.3/4.4 regression] ICE using offsetof with array

2009-01-02 Thread jakub at gcc dot gnu dot org
--- 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

[Bug c++/38699] [4.2/4.3/4.4 regression] ICE using offsetof with array

2009-01-02 Thread reichelt at gcc dot gnu dot org
-- 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