From 2f56b2253d0381ce3df570af0084a47664a5f721 Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Mon, 13 Feb 2012 15:11:14 +0400 Subject: [PATCH] DMD Issue 7196 - Unfair function address overload resolution --- dmd2/expression.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dmd2/expression.c b/dmd2/expression.c index 1038a378..58467841 100644 --- a/dmd2/expression.c +++ b/dmd2/expression.c @@ -7495,12 +7495,29 @@ Lagain: e1 = new DsymbolExp(loc, se->sds); e1 = e1->semantic(sc); } +#if IN_LLVM + else if (e1->op == TOKaddress) + { + AddrExp *ae = (AddrExp *)e1; + if (ae->e1->op == TOKvar) { + VarExp *ve = (VarExp*)ae->e1; + if (!ve->var->isOut() && !ve->var->isRef() && + !ve->var->isImportedSymbol() && ve->hasOverloads) + { + e1 = ve; + } + } + + + } +#else else if (e1->op == TOKsymoff && ((SymOffExp *)e1)->hasOverloads) { SymOffExp *se = (SymOffExp *)e1; e1 = new VarExp(se->loc, se->var, 1); e1 = e1->semantic(sc); } +#endif #if 1 // patch for #540 by Oskar Linde else if (e1->op == TOKdotexp) {