public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/96156] New: d: No RVO when returning struct literals initialized with constructor.
@ 2020-07-10 15:22 ibuclaw at gdcproject dot org
  2020-07-27 22:34 ` [Bug d/96156] " ibuclaw at gdcproject dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ibuclaw at gdcproject dot org @ 2020-07-10 15:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96156

            Bug ID: 96156
           Summary: d: No RVO when returning struct literals initialized
                    with constructor.
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

The address of 's' should become the 'this' pointer of the __ctor() call.

struct S66 {
    int x;
    __gshared void* ptr;
    @disable this(this);
    this(int x) { ptr = &this; this.x = x; }
}
auto f66() { return g66(); }
auto g66() { return h66(); }
auto h66() { return S66(100); }
void main()
{
    auto s = f66();
    assert(&s == S66.ptr);
}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-26  8:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 15:22 [Bug d/96156] New: d: No RVO when returning struct literals initialized with constructor ibuclaw at gdcproject dot org
2020-07-27 22:34 ` [Bug d/96156] " ibuclaw at gdcproject dot org
2020-08-26  7:45 ` ibuclaw at gdcproject dot org
2020-08-26  8:05 ` cvs-commit at gcc dot gnu.org
2020-08-26  8:07 ` ibuclaw at gdcproject dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).