Summary: Cannot put function attributes (const, pure, ...) on
                    the right of an auto-return function
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-04-20 12:02:05 PDT ---
Test case:

auto f() pure {
    return 4;
void main() {
    assert(f() == 4);

As of 2.052 it raises the errors

x.d(1): function declaration without return type. (Note that constructors are
always named 'this')
x.d(1): no identifier for declarator pure f()

The error will not happen if the attribute 'pure' is put at the front (pure
auto f() { ... }) or the exact return type is provided (int f() pure { ... }).

Possibly the same issue as bug 4785.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to