[Issue 13309] DMD accepts yet another invalid alias declaration

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Aug 19 02:00:03 PDT 2014


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

--- Comment #5 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to briancschott from comment #0)
> alias extern(Windows) HRESULT fnNtQuerySystemInformation( uint
> SystemInformationClass, void* info, uint infoLength, uint* ReturnLength )
> nothrow;
> 
> This does not match any documented form of alias declaration, yet it is
> accepted by DMD.

> alias extern(Windows) HRESULT fnNtQuerySystemInformation( uint SystemInformationClass, void* info, uint infoLength, uint* ReturnLength ) nothrow;

No, it's valid in the grammar.

AliasDeclaration:
    alias StorageClasses_opt BasicType Declarator

Declarator:
    BasicType2_opt Identifier DeclaratorSuffixes_opt

DeclaratorSuffix:
    Parameters MemberFunctionAttributes_opt

Parameters:
    ( ParameterList_opt )

...

And then, the name fnNtQuerySystemInformation will alias a function type:

extern(Windows) HRESULT(uint, void*, uint, uint*) nothrow

--


More information about the Digitalmars-d-bugs mailing list