As noted in TC , copying may not be possible when passing small trivially copied types to functions.
This is because the calling conventions for some ABIs (for example, System V ABI) suggest that rather small trivially copied types will be transferred in small registers, and not in memory. For example, SysV will classify such types in the INTEGER argument class, and not in the MEMORY class.
This means that if you pass such an argument to a function that requires a parameter address, the contents of the register will need to be copied onto the stack in order to have a valid address. Thus, a copy from the rvalue argument to the by-value parameter cannot be executed, even if the language rules can say that this is possible.
Of course, copying in this case is rather useless for efficiency, but for those who are curious, an easy way to make a copy of rights on such platforms is to make the class not trivially copied. An example of this is to make the destructor user-provided:
struct foo { foo() { p = this; } ~foo(){}
This causes copy-elision to appear on both Clang 3.7 and GCC 5.3.
Live demo
source share