2 Language Reference

The implementation of the D programming language used by the GNU D compiler is shared with parts of the front-end for the Digital Mars D compiler, hosted at https://github.com/dlang/dmd/. This common front-end covers lexical analysis, parsing, and semantic analysis of the D programming language defined in the documents at https://dlang.org/.

The implementation details described in this manual are GNU D extensions to the D programming language. If you want to write code that checks whether these features are available, you can test for the predefined version GNU, or you can check whether a specific feature is compilable using __traits(compiles).

version (GNU)
{
    import gcc.builtins;
    return __builtin_atan2(x, y);
}

static if (__traits(compiles, { asm {"";} }))
{
    asm { "magic instruction"; }
}