Bug 1250666 - Forward Variant's move constructor argument correctly to the underlying variant type. r=waldo
authorSeth Fowler <mark.seth.fowler@gmail.com>
Fri, 26 Feb 2016 21:01:49 -0800
changeset 324159 93a262a768d62f6dc05e00833e43bb99bd974047
parent 324158 67c35da48ad1cdac96d77c5dd33cfab9612971ca
child 324160 39a1e216208199904ef3a562eb5d643efc08223d
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs1250666
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1250666 - Forward Variant's move constructor argument correctly to the underlying variant type. r=waldo
mfbt/Variant.h
--- a/mfbt/Variant.h
+++ b/mfbt/Variant.h
@@ -428,17 +428,17 @@ public:
            // RefT captures both const& as well as && (as intended, to support
            // perfect forwarding), so we have to remove those qualifiers here
            // when ensuring that T is a variant of this type, and getting T's
            // tag, etc.
            typename T = typename detail::SelectVariantType<RefT, Ts...>::Type>
   explicit Variant(RefT&& aT)
     : tag(Impl::template tag<T>())
   {
-    new (ptr()) T(Forward<T>(aT));
+    new (ptr()) T(Forward<RefT>(aT));
   }
 
   /**
    * Constructs this Variant from an AsVariantTemporary<T> such that T can be
    * stored in one of the types allowable in this Variant. This is used in the
    * implementation of AsVariant().
    */
   template<typename RefT,