public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/96157] New: d: No NRVO when returning an array of a non-POD struct
@ 2020-07-10 15:26 ibuclaw at gdcproject dot org
  2020-07-10 15:30 ` [Bug d/96157] " 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:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96157
           Summary: d: No NRVO when returning an array of a non-POD struct
           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: ---

struct S
{
    @disable this(this); // triggers nrvo
    int v;
}

__gshared void* p;

S[1000] foo() nothrow
{
    typeof(return) d;
    p = &d;
    return d;
}

extern(C) void main() nothrow
{
    auto d = foo();
    assert(p == &d);
}

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

end of thread, other threads:[~2020-08-30 14:24 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:26 [Bug d/96157] New: d: No NRVO when returning an array of a non-POD struct ibuclaw at gdcproject dot org
2020-07-10 15:30 ` [Bug d/96157] " ibuclaw at gdcproject dot org
2020-08-26  8:04 ` cvs-commit at gcc dot gnu.org
2020-08-26  8:05 ` ibuclaw at gdcproject dot org
2020-08-30 14:24 ` cvs-commit at gcc dot gnu.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).