This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ICE: malformed code gives ICE for &(C::m)


Here is a little annoying one that gives an ICE for:

struct C {
    bool m();
};

void toto() {
    bool (C::*f)() = &(C::m);
}

The fix is:

	* init.c (resolve_offset_ref): Handle OVERLOADs.

Attachment: init.c.diffs
Description: Binary data




This is a regression from gcc-20011206. The ICE it gives is:

lair bash[33] ./cc1plus.orig -quiet t.cc
t.cc: In function `void toto()':
t.cc:6: internal compiler error: Internal compiler error in resolve_offset_ref,
at cp/init.c:1881
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

The new behavior is:

lair bash[122] ./cc1plus t.cc -quiet
t.cc: In function `void toto()':
t.cc:6: error: assuming pointer to member `bool C::m()'
t.cc:6: error: (a pointer to member can only be formed with `&C::m()')

Can I put it in? Tested on i586-pc-linux-gnu, no regressions. I'll check in the testcase as well if OKed.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]