Bug 3268 – can't compare pointer to functions when one is const

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2009-08-27T14:10:00Z
Last change time
2015-06-09T01:20:08Z
Keywords
patch
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2009-08-27T14:10:00Z
Comment #1 by andrei — 2009-08-27T14:11:13Z
void fun() {} void main() { auto a = &fun; const b = a; assert(a == b); } This fails to compile. The error message is odd too: Error: array equality comparison type mismatch, void function() vs const(void function()) The code should work.
Comment #2 by yebblies — 2011-06-06T20:37:46Z
Comment #3 by yebblies — 2011-06-08T04:41:23Z
Comment #4 by bugzilla — 2011-09-02T02:37:40Z