[Issue 12802] New: Allow optional 'StorageClasses' for new alias syntax

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun May 25 23:36:01 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12802

          Issue ID: 12802
           Summary: Allow optional 'StorageClasses' for new alias syntax
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: k.hara.pg at gmail.com

Old style alias declaration can have optional 'StorageClasses'.

alias extern(C) ref pure nothrow int function() FP;
pragma(msg, FP);  // prints: extern (C) int function() pure nothrow ref

But new alias syntax (introduced in enhancement issue 3011) does not support
it.

alias FP = extern(C) ref pure nothrow int function();
---
test.d(1): Error: basic type expected, not extern
test.d(1): Error: semicolon expected to close alias declaration
test.d(1): Error: no identifier for declarator extern (C) int function()

The latter syntax should also be accepted and have same semantics with the
former.

--


More information about the Digitalmars-d-bugs mailing list