#17 closed defect (fixed)
Can't assign 0 to function pointer
Reported by: | Thierry Delisle | Owned by: | |
---|---|---|---|
Priority: | minor | Component: | cfa-cc |
Version: | 1.0 | Keywords: | |
Cc: |
Description ¶
This code crashes the compiler:
int main() { int (*foo)(int) = 0; }
Change History (3)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Owner: | set to Rob Schluntz <rschlunt@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In 969ee0d:
comment:3 Changed 8 years ago by
That's an interesting observation. I'm not sure why it's commented, but it might be necessary for assertions?
In any case, I've handled the zero_t case separately for tuple specialization, since zero_t is special.
Note: See
TracTickets for help on using
tickets.
There's a commented-out line 808 in prelude.cf, that looks like it would do the right thing:
// forall( ftype FT ) void ?{}( FT * *, zero_t );
It looks like Rob put it in in commit 0b150ecc back in late May -- Rob, do you remember why it's commented out?