Bug 10603 – Refused pure attribute on the left for function pointer argument
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-07-10T17:39:00Z
Last change time
2015-03-03T03:57:34Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2013-07-10T17:39:31Z
void foo(int function(int) pure f1) {} // OK
void bar(pure int function(int) f2) {} // error
void main() {
int function(int) pure f3; // OK
pure int function(int) f4; // OK
}
DMD 2.064alpha gives:
test.d(2): Error: basic type expected, not pure
test.d(2): Error: found 'pure' when expecting ')'
test.d(2): Error: semicolon expected following function declaration
test.d(2): Error: semicolon expected, not ')'
test.d(2): Error: Declaration expected, not ')'
test.d(6): Error: unrecognized declaration
Comment #1 by k.hara.pg — 2015-03-03T03:57:34Z
*** This issue has been marked as a duplicate of issue 4505 ***