[Issue 22499] New: Copy construction of nested struct rejected
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 9 22:17:03 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22499
Issue ID: 22499
Summary: Copy construction of nested struct rejected
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: timon.gehr at gmx.ch
DMD 2.098.0:
---
auto makeFoo(){
struct Foo{
this(ref typeof(this)){}
}
return Foo();
}
void main(){
auto foo=makeFoo();
auto bar=foo; // error
}
---
Yields:
---
Error: cannot access frame pointer of `tt.makeFoo.Foo`
---
This makes no sense, as there is a frame pointer in foo that can just be copied
over to bar before calling the copy constructor. core.lifetime.copyEmplace
actually handles this case correctly.
--
More information about the Digitalmars-d-bugs
mailing list