This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Fix conditional expression bug
AbandonedPublic

Authored by terrelln on Jan 28 2016, 5:26 PM.

Details

Summary

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.

Diff Detail

Event Timeline

terrelln updated this revision to Diff 46328.Jan 28 2016, 5:26 PM
terrelln retitled this revision from to [Sema] Fix conditional expression bug.
terrelln updated this object.
terrelln updated this object.Jan 28 2016, 7:34 PM
terrelln added a reviewer: doug.gregor.
terrelln abandoned this revision.Feb 1 2016, 9:18 AM