https://bugs.llvm.org/show_bug.cgi?id=42317

Richard Smith <richard-l...@metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-l...@metafoo.co.uk> ---
"return r;" implicitly invokes the copy constructor of B to copy the return
value. You made that constructor explicit, so it can't be implicitly invoked
any more. Most of your example is an irrelevant distraction; the relevant part
is:

struct B {
    B();
    explicit B(B const &);
};

B f() { 
    B r;
    return r;  // error, can't return B here because there is no implicit copy
constructor
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to