Don <> changed:

           What    |Removed                     |Added
           Keywords|                            |patch, wrong-code
            Version|2.018                       |1.040

--- Comment #1 from Don <>  2009-05-27 05:43:58 PDT ---
This bug also applies to D1. And it silently generates bad code if compiled
with -O. Reduced test case:
struct A {
    void foo() {}
A bar() {A a; return a;}
void main() {
    void delegate() x = &bar().foo;
Root cause: should not be able to make a delegate from something which isn't an
lvalue (just as you can't take address of a function return).

PATCH: add one line in expression.c, DelegateExp::semantic(Scope *sc)

    if (func->needThis())
        e1 = getRightThis(loc, sc, ad, e1, func);
+         e1->toLvalue(sc, e1);   // add this line

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to