[patch] Fix second part of PR c++/27601: ICE using offsetof with member functions
Mark Mitchell
mark@codesourcery.com
Mon Jun 5 17:08:00 GMT 2006
Volker Reichelt wrote:
> While applying
> http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00161.html
> I noticed that the following invalid code snippet also triggers an ICE:
>
> struct bar {
> void foo();
> };
>
> int a = __builtin_offsetof(bar, foo);
>
> bug.cc:5: internal compiler error: tree check: expected field_decl, have baselink in fold_offsetof_1, at c-common.c:5992
> Please submit a full bug report, [etc.]
Can't we catch this in the C++ parser? __builtin_offsetof is handled by
its own parsing routine, so before we call fold_offsetof, we already
know what EXPR is. Wouldn't calling invalid_nonstatic_memfn_p fix this?
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc-patches
mailing list