D just uses __LINE__, because it hasn't got a preprocessor so the compiler can resolve the token properly.
The implementation of that is at https://github.com/dlang/dmd/blob/v2.094.2/src/dmd/expressio...