This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix second part of PR c++/27601: ICE using offsetof with member functions
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 05 Jun 2006 10:07:42 -0700
- Subject: Re: [patch] Fix second part of PR c++/27601: ICE using offsetof with member functions
- References: <tkrat.0d005cf6778fa123@igpm.rwth-aachen.de>
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