This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug objc/47077] New: ICE on invalid code (method implementation outside of implementation context)
- From: "nicola at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Dec 2010 17:16:03 +0000
- Subject: [Bug objc/47077] New: ICE on invalid code (method implementation outside of implementation context)
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47077
Summary: ICE on invalid code (method implementation outside of
implementation context)
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: objc
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: nicola@gcc.gnu.org
Here is a minimal testcase --
- (int) method: (int)argument
{
return argument;
}
The crash is due to the fact that, when we find a method outside an
implementation context, we don't even create a function context. So, all the
code in the method will be parsed in a void and crash the compiler at the first
reference to the local bind or such like.
We most likely ought to review the code start/closing the method, and if the
method is outside of an implementation context, start/close it normally but
without associating it with a class. I suppose 'self' could be set to be of
type 'id'.
Thanks