[Issue 5191] Combination of pure and nothrow result in a function that does nothing
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 10 00:28:38 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5191
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
--- Comment #2 from Don <clugdbug at yahoo.com.au> 2010-11-10 00:27:33 PST ---
Extra test case (add to the end of the original test case):
---
void delegate (int) pure nothrow dg = &foo.add!(int);
dg(7);
assert(foo.value == 20);
--
PATCH: e2ir.c, callfunc(), line 294. To determine if a function is strongly
pure, you need to look at the function declaration, not just the function type,
since the 'this' parameter isn't part of the type.
-----
else if (ep)
{ /* Do not do "no side effect" calls if a hidden parameter is passed,
* as the return value is stored through the hidden parameter, which
* is a side effect.
*/
- e = el_bin((tf->purity == PUREstrong && tf->isnothrow && (retmethod !=
RETstack)) ?
+ e = el_bin(((fd ? fd->isPure() : tf->purity) == PUREstrong &&
tf->isnothrow && (retmethod != RETstack)) ?
OPcallns : OPcall,tyret,ec,ep);
if (tf->varargs)
e->Eflags |= EFLAGS_variadic;
}
else
- { e = el_una((tf->purity == PUREstrong && tf->isnothrow && (retmethod !=
RETstack)) ?
+ { e = el_una(((fd ? fd->isPure() : tf->purity) == PUREstrong &&
tf->isnothrow && (retmethod != RETstack)) ?
OPucallns : OPucall,tyret,ec);
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list