This is an archive of the discontinued LLVM Phabricator instance.

Revert the return type for `emplace_(back|front)` to `void` in C++14 and before
ClosedPublic

Authored by mclow.lists on Jan 19 2017, 7:16 PM.

Details

Summary

In C++11/14, the return type of emplace_front and emplace_back was void. In http://wg21.link/p0084, Alan Talbot proposed changing the return type to return a reference to the newly created element.

We implemented that - but unilaterally.
This changes that, so that the change is only realized when building for C++17 or later.
This fixes https://llvm.org/bugs/show_bug.cgi?id=31680.

Diff Detail

Event Timeline

mclow.lists created this revision.Jan 19 2017, 7:16 PM
EricWF edited edge metadata.Jan 20 2017, 10:26 AM

I hate that we have to conditionalize this change at all, but your changes LGTM.

hans added a subscriber: hans.Jan 23 2017, 4:33 PM

This sounds like something we'll want to merge to the release branch when it lands?

mclow.lists accepted this revision.Jan 24 2017, 3:21 PM

Landed as revision 292990.

This revision is now accepted and ready to land.Jan 24 2017, 3:21 PM
mclow.lists closed this revision.Feb 13 2017, 12:41 PM

Landed as r292990.