If I have a function that returns an object, but this return value is never used by the caller, will the compiler optimize away the copy? (Possibly an always/sometimes/never
just tried this example on compiler explorer, and at -O3 the mov is not generated when the return value is not used.
mov
https://gcc.godbolt.org/z/v5WGPr