www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10603] New: Refused pure attribute on the left for function pointer argument

http://d.puremagic.com/issues/show_bug.cgi?id=10603

           Summary: Refused pure attribute on the left for function
                    pointer argument
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 10 2013