[Issue 20376] @disable this(ref return scope Foo rhs) enables broken binaries (out-of-bounds access)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 10 03:53:35 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20376

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com
           Hardware|x86_64                      |All
                 OS|Linux                       |All

--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
reduced w/o phobos. should not compile

---
struct Foo
{
    this(ref scope Foo);
}

ubyte fun()
{
    return Foo();
}

void main(){} 
---

should fail with

---
Error: cannot implicitly convert expression `Foo()` of type `Foo` to `ubyte`
---

--


More information about the Digitalmars-d-bugs mailing list