When determining the type of a conditional expression clang didn't correctly perform the copy initialization required by the standard section 5.16p3b3.1. This resulted in the incorrect constructor being called in the added test case.
See https://llvm.org/bugs/show_bug.cgi?id=24227.
Secondly, in the same test case the old code copy initializes twice. The second copy initialization calls the M(const M&&) constructor, which is deleted so the code didn't compile. I removed the call to the second copy initialization in this case, although I'm not certain if this is the correct behavior.