[PATCH] D28933: Revert the return type for `emplace_(back|front)` to `void` in C++14 and before

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 19 19:16:35 PST 2017


mclow.lists created this revision.

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.


https://reviews.llvm.org/D28933

Files:
  include/deque
  include/forward_list
  include/list
  include/queue
  include/stack
  include/vector
  test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp
  test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp
  test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp
  test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp
  test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp
  test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp
  test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp
  test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
  test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28933.85092.patch
Type: text/x-patch
Size: 26930 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170120/8dd8c55a/attachment-0001.bin>


More information about the cfe-commits mailing list