Skip to content
6 changes: 6 additions & 0 deletions compiler/src/dmd/cparse.d
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,12 @@ final class CParser(AST) : Parser!AST
const id = token.ident.toString();
if (id.length > 2 && id[0] == '_' && id[1] == '_') // leading double underscore
{
if (token.ident is Id.FUNCTION) //__FUNCTION__ predefined macro
{
e = new AST.FuncInitExp(loc);
nextToken();
break;
}
if (token.ident is Id.__func__)
{
addFuncName = true; // implicitly declare __func__
Expand Down
Loading