Change emplace for vector and deque to create the temporary (when necessary) before any changes to the container are made.  Nikolay Ivchenkov deserves the credit for pushing this problem and the solution for it.

llvm-svn: 159918
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 598f702b04e0eccae3e341207b86326793228dcd
diff --git a/include/vector b/include/vector
index 0d5b6b8..04a23ab 100644
--- a/include/vector
+++ b/include/vector
@@ -1681,8 +1681,9 @@
         }
         else
         {
+            value_type __tmp(_VSTD::forward<_Args>(__args)...);
             __move_range(__p, this->__end_, __p + 1);
-            *__p = value_type(_VSTD::forward<_Args>(__args)...);
+            *__p = _VSTD::move(__tmp);
         }
     }
     else