From 2180bdba879cfe15ed13fe549a5e69d8bcef00e8 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Oct 25 2017 13:17:17 +0000 Subject: more C++11 type handling (enable_if) --- diff --git a/chromium-62.0.3202.62-epel7-c++11-decay-enable_if-type.patch b/chromium-62.0.3202.62-epel7-c++11-decay-enable_if-type.patch new file mode 100644 index 0000000..0e651c6 --- /dev/null +++ b/chromium-62.0.3202.62-epel7-c++11-decay-enable_if-type.patch @@ -0,0 +1,250 @@ +diff -up chromium-62.0.3202.62/base/bind_helpers.h.epel7-c++11 chromium-62.0.3202.62/base/bind_helpers.h +--- chromium-62.0.3202.62/base/bind_helpers.h.epel7-c++11 2017-10-25 08:50:15.692276363 -0400 ++++ chromium-62.0.3202.62/base/bind_helpers.h 2017-10-25 09:12:15.889484145 -0400 +@@ -282,7 +282,7 @@ class PassedWrapper { + }; + + template +-using Unwrapper = BindUnwrapTraits>; ++using Unwrapper = BindUnwrapTraits::type>; + + template + auto Unwrap(T&& o) -> decltype(Unwrapper::Unwrap(std::forward(o))) { +@@ -438,7 +438,7 @@ static inline internal::OwnedWrapper + // Both versions of Passed() prevent T from being an lvalue reference. The first + // via use of enable_if, and the second takes a T* which will not bind to T&. + template ::value>* = nullptr> ++ typename std::enable_if::value>::type* = nullptr> + static inline internal::PassedWrapper Passed(T&& scoper) { + return internal::PassedWrapper(std::move(scoper)); + } +@@ -537,9 +537,9 @@ template , +- std::enable_if_t< ++ typename std::enable_if< + internal::IsWeakMethod::is_method, +- BoundArgs...>::value>> { ++ BoundArgs...>::value>::type> { + static constexpr bool is_cancellable = true; + + template +diff -up chromium-62.0.3202.62/base/bind.h.epel7-c++11 chromium-62.0.3202.62/base/bind.h +--- chromium-62.0.3202.62/base/bind.h.epel7-c++11 2017-10-25 08:55:22.603877014 -0400 ++++ chromium-62.0.3202.62/base/bind.h 2017-10-25 08:56:41.636714097 -0400 +@@ -53,7 +53,7 @@ struct AssertConstructible { + // reference with repeating callbacks--is used instead of base::Passed(). + static_assert( + param_is_forwardable || +- !std::is_constructible&&>::value, ++ !std::is_constructible::type&&>::value, + "Bound argument |i| is move-only but will be forwarded by copy. " + "Ensure |Arg| is bound using base::Passed(), not std::move()."); + static_assert( +@@ -64,7 +64,7 @@ struct AssertConstructible { + static constexpr bool arg_is_storable = + std::is_constructible::value; + static_assert(arg_is_storable || +- !std::is_constructible&&>::value, ++ !std::is_constructible::type&&>::value, + "Bound argument |i| is move-only but will be bound by copy. " + "Ensure |Arg| is mutable and bound using std::move()."); + static_assert(arg_is_storable, +@@ -88,7 +88,7 @@ struct AssertBindArgsValidity, + TypeList, + TypeList> +- : AssertConstructible, Unwrapped, Params>... { ++ : AssertConstructible::type, Unwrapped, Params>... { + static constexpr bool ok = true; + }; + +@@ -98,14 +98,14 @@ struct TransformToUnwrappedTypeImpl; + + template + struct TransformToUnwrappedTypeImpl { +- using StoredType = std::decay_t; ++ using StoredType = typename std::decay::type; + using ForwardType = StoredType&&; + using Unwrapped = decltype(Unwrap(std::declval())); + }; + + template + struct TransformToUnwrappedTypeImpl { +- using StoredType = std::decay_t; ++ using StoredType = typename std::decay::type; + using ForwardType = const StoredType&; + using Unwrapped = decltype(Unwrap(std::declval())); + }; +@@ -153,7 +153,7 @@ using MakeUnwrappedTypeList = + template + inline OnceCallback> + BindOnce(Functor&& functor, Args&&... args) { +- static_assert(!internal::IsOnceCallback>() || ++ static_assert(!internal::IsOnceCallback::type>() || + (std::is_rvalue_reference() && + !std::is_const>()), + "BindOnce requires non-const rvalue for OnceCallback binding." +@@ -197,7 +197,7 @@ template > + BindRepeating(Functor&& functor, Args&&... args) { + static_assert( +- !internal::IsOnceCallback>(), ++ !internal::IsOnceCallback::type>(), + "BindRepeating cannot bind OnceCallback. Use BindOnce with std::move()."); + + // This block checks if each |args| matches to the corresponding params of the +diff -up chromium-62.0.3202.62/base/bind_internal.h.epel7-c++11 chromium-62.0.3202.62/base/bind_internal.h +--- chromium-62.0.3202.62/base/bind_internal.h.epel7-c++11 2017-10-25 08:52:20.018873878 -0400 ++++ chromium-62.0.3202.62/base/bind_internal.h 2017-10-25 09:14:48.526096108 -0400 +@@ -125,7 +125,7 @@ struct FunctorTraits; + // to the function type while capturing lambdas can't. + template + struct FunctorTraits::value>> { ++ typename std::enable_if::value>::type> { + using RunType = ExtractCallableRunType; + static constexpr bool is_method = false; + static constexpr bool is_nullable = false; +@@ -256,7 +256,7 @@ struct FunctorTraits +-using MakeFunctorTraits = FunctorTraits>; ++using MakeFunctorTraits = FunctorTraits::type>; + + // InvokeHelper<> + // +@@ -341,7 +341,7 @@ struct Invoker::is_method; + +- using DecayedArgsTuple = std::decay_t; ++ using DecayedArgsTuple = typename std::decay::type; + static constexpr bool is_weak_call = + IsWeakMethod...>(); +@@ -383,13 +383,13 @@ struct BindTypeHelper { + }; + + template +-std::enable_if_t::is_nullable, bool> IsNull( ++typename std::enable_if::is_nullable, bool>::type IsNull( + const Functor& functor) { + return !functor; + } + + template +-std::enable_if_t::is_nullable, bool> IsNull( ++typename std::enable_if::is_nullable, bool>::type IsNull( + const Functor&) { + return false; + } +@@ -479,33 +479,33 @@ struct MakeBindStateTypeImpl; + + template + struct MakeBindStateTypeImpl { +- static_assert(!HasRefCountedTypeAsRawPtr...>::value, ++ static_assert(!HasRefCountedTypeAsRawPtr::type...>::value, + "A parameter is a refcounted type and needs scoped_refptr."); +- using Type = BindState, std::decay_t...>; ++ using Type = BindState::type, typename std::decay::type...>; + }; + + template + struct MakeBindStateTypeImpl { +- using Type = BindState>; ++ using Type = BindState::type>; + }; + + template + struct MakeBindStateTypeImpl { + static_assert(!std::is_array>::value, + "First bound argument to a method cannot be an array."); +- static_assert(!HasRefCountedTypeAsRawPtr...>::value, ++ static_assert(!HasRefCountedTypeAsRawPtr::type...>::value, + "A parameter is a refcounted type and needs scoped_refptr."); + + private: +- using DecayedReceiver = std::decay_t; ++ using DecayedReceiver = typename std::decay::type; + + public: + using Type = BindState< +- std::decay_t, ++ typename std::decay::type, + std::conditional_t::value, + scoped_refptr>, + DecayedReceiver>, +- std::decay_t...>; ++ typename std::decay::type...>; + }; + + template +diff -up chromium-62.0.3202.62/base/containers/span.h.epel7-c++11 chromium-62.0.3202.62/base/containers/span.h +--- chromium-62.0.3202.62/base/containers/span.h.epel7-c++11 2017-10-25 08:51:25.260372472 -0400 ++++ chromium-62.0.3202.62/base/containers/span.h 2017-10-25 09:13:53.035964265 -0400 +@@ -27,7 +27,7 @@ template + struct IsSpanImpl> : std::true_type {}; + + template +-using IsSpan = IsSpanImpl>; ++using IsSpan = IsSpanImpl::type>; + + template + struct IsStdArrayImpl : std::false_type {}; +@@ -36,7 +36,7 @@ template + struct IsStdArrayImpl> : std::true_type {}; + + template +-using IsStdArray = IsStdArrayImpl>; ++using IsStdArray = IsStdArrayImpl::type>; + + template + using IsLegalSpanConversion = std::is_convertible; +@@ -51,7 +51,7 @@ using ContainerHasIntegralSize = + + template + using EnableIfLegalSpanConversion = +- std::enable_if_t::value>; ++ typename std::enable_if::value>::type; + + // SFINAE check if Container can be converted to a span. Note that the + // implementation details of this check differ slightly from the requirements in +@@ -67,18 +67,18 @@ using EnableIfLegalSpanConversion = + // container. + template + using EnableIfSpanCompatibleContainer = +- std::enable_if_t::value && ++ typename std::enable_if::value && + !internal::IsStdArray::value && + ContainerHasConvertibleData::value && +- ContainerHasIntegralSize::value>; ++ ContainerHasIntegralSize::value>::type; + + template + using EnableIfConstSpanCompatibleContainer = +- std::enable_if_t::value && ++ typename std::enable_if::value && + !internal::IsSpan::value && + !internal::IsStdArray::value && + ContainerHasConvertibleData::value && +- ContainerHasIntegralSize::value>; ++ ContainerHasIntegralSize::value>::type; + + } // namespace internal + +diff -up chromium-62.0.3202.62/ipc/ipc_message_templates.h.epel7-c++11 chromium-62.0.3202.62/ipc/ipc_message_templates.h +--- chromium-62.0.3202.62/ipc/ipc_message_templates.h.epel7-c++11 2017-10-25 09:15:02.382879317 -0400 ++++ chromium-62.0.3202.62/ipc/ipc_message_templates.h 2017-10-25 09:15:36.609343836 -0400 +@@ -67,7 +67,7 @@ void DispatchToMethodImpl(ObjT* obj, + // The following function is for async IPCs which have a dispatcher with an + // extra parameter specified using IPC_BEGIN_MESSAGE_MAP_WITH_PARAM. + template +-std::enable_if_t>::value> ++typename std::enable_if>::value>::type + DispatchToMethod(ObjT* obj, + void (ObjT::*method)(P*, Args...), + P* parameter, diff --git a/chromium-62.0.3202.62-epel7-c++11-decay-type.patch b/chromium-62.0.3202.62-epel7-c++11-decay-type.patch deleted file mode 100644 index af0c5a7..0000000 --- a/chromium-62.0.3202.62-epel7-c++11-decay-type.patch +++ /dev/null @@ -1,160 +0,0 @@ -diff -up chromium-62.0.3202.62/base/bind_helpers.h.epel7-c++11 chromium-62.0.3202.62/base/bind_helpers.h ---- chromium-62.0.3202.62/base/bind_helpers.h.epel7-c++11 2017-10-25 08:50:15.692276363 -0400 -+++ chromium-62.0.3202.62/base/bind_helpers.h 2017-10-25 08:50:39.977611740 -0400 -@@ -282,7 +282,7 @@ class PassedWrapper { - }; - - template --using Unwrapper = BindUnwrapTraits>; -+using Unwrapper = BindUnwrapTraits::type>; - - template - auto Unwrap(T&& o) -> decltype(Unwrapper::Unwrap(std::forward(o))) { -diff -up chromium-62.0.3202.62/base/bind.h.epel7-c++11 chromium-62.0.3202.62/base/bind.h ---- chromium-62.0.3202.62/base/bind.h.epel7-c++11 2017-10-25 08:55:22.603877014 -0400 -+++ chromium-62.0.3202.62/base/bind.h 2017-10-25 08:56:41.636714097 -0400 -@@ -53,7 +53,7 @@ struct AssertConstructible { - // reference with repeating callbacks--is used instead of base::Passed(). - static_assert( - param_is_forwardable || -- !std::is_constructible&&>::value, -+ !std::is_constructible::type&&>::value, - "Bound argument |i| is move-only but will be forwarded by copy. " - "Ensure |Arg| is bound using base::Passed(), not std::move()."); - static_assert( -@@ -64,7 +64,7 @@ struct AssertConstructible { - static constexpr bool arg_is_storable = - std::is_constructible::value; - static_assert(arg_is_storable || -- !std::is_constructible&&>::value, -+ !std::is_constructible::type&&>::value, - "Bound argument |i| is move-only but will be bound by copy. " - "Ensure |Arg| is mutable and bound using std::move()."); - static_assert(arg_is_storable, -@@ -88,7 +88,7 @@ struct AssertBindArgsValidity, - TypeList, - TypeList> -- : AssertConstructible, Unwrapped, Params>... { -+ : AssertConstructible::type, Unwrapped, Params>... { - static constexpr bool ok = true; - }; - -@@ -98,14 +98,14 @@ struct TransformToUnwrappedTypeImpl; - - template - struct TransformToUnwrappedTypeImpl { -- using StoredType = std::decay_t; -+ using StoredType = typename std::decay::type; - using ForwardType = StoredType&&; - using Unwrapped = decltype(Unwrap(std::declval())); - }; - - template - struct TransformToUnwrappedTypeImpl { -- using StoredType = std::decay_t; -+ using StoredType = typename std::decay::type; - using ForwardType = const StoredType&; - using Unwrapped = decltype(Unwrap(std::declval())); - }; -@@ -153,7 +153,7 @@ using MakeUnwrappedTypeList = - template - inline OnceCallback> - BindOnce(Functor&& functor, Args&&... args) { -- static_assert(!internal::IsOnceCallback>() || -+ static_assert(!internal::IsOnceCallback::type>() || - (std::is_rvalue_reference() && - !std::is_const>()), - "BindOnce requires non-const rvalue for OnceCallback binding." -@@ -197,7 +197,7 @@ template > - BindRepeating(Functor&& functor, Args&&... args) { - static_assert( -- !internal::IsOnceCallback>(), -+ !internal::IsOnceCallback::type>(), - "BindRepeating cannot bind OnceCallback. Use BindOnce with std::move()."); - - // This block checks if each |args| matches to the corresponding params of the -diff -up chromium-62.0.3202.62/base/bind_internal.h.epel7-c++11 chromium-62.0.3202.62/base/bind_internal.h ---- chromium-62.0.3202.62/base/bind_internal.h.epel7-c++11 2017-10-25 08:52:20.018873878 -0400 -+++ chromium-62.0.3202.62/base/bind_internal.h 2017-10-25 08:55:07.779282724 -0400 -@@ -256,7 +256,7 @@ struct FunctorTraits --using MakeFunctorTraits = FunctorTraits>; -+using MakeFunctorTraits = FunctorTraits::type>; - - // InvokeHelper<> - // -@@ -341,7 +341,7 @@ struct Invoker::is_method; - -- using DecayedArgsTuple = std::decay_t; -+ using DecayedArgsTuple = typename std::decay::type; - static constexpr bool is_weak_call = - IsWeakMethod...>(); -@@ -479,33 +479,33 @@ struct MakeBindStateTypeImpl; - - template - struct MakeBindStateTypeImpl { -- static_assert(!HasRefCountedTypeAsRawPtr...>::value, -+ static_assert(!HasRefCountedTypeAsRawPtr::type...>::value, - "A parameter is a refcounted type and needs scoped_refptr."); -- using Type = BindState, std::decay_t...>; -+ using Type = BindState::type, typename std::decay::type...>; - }; - - template - struct MakeBindStateTypeImpl { -- using Type = BindState>; -+ using Type = BindState::type>; - }; - - template - struct MakeBindStateTypeImpl { - static_assert(!std::is_array>::value, - "First bound argument to a method cannot be an array."); -- static_assert(!HasRefCountedTypeAsRawPtr...>::value, -+ static_assert(!HasRefCountedTypeAsRawPtr::type...>::value, - "A parameter is a refcounted type and needs scoped_refptr."); - - private: -- using DecayedReceiver = std::decay_t; -+ using DecayedReceiver = typename std::decay::type; - - public: - using Type = BindState< -- std::decay_t, -+ typename std::decay::type, - std::conditional_t::value, - scoped_refptr>, - DecayedReceiver>, -- std::decay_t...>; -+ typename std::decay::type...>; - }; - - template -diff -up chromium-62.0.3202.62/base/containers/span.h.epel7-c++11 chromium-62.0.3202.62/base/containers/span.h ---- chromium-62.0.3202.62/base/containers/span.h.epel7-c++11 2017-10-25 08:51:25.260372472 -0400 -+++ chromium-62.0.3202.62/base/containers/span.h 2017-10-25 08:52:07.597213826 -0400 -@@ -27,7 +27,7 @@ template - struct IsSpanImpl> : std::true_type {}; - - template --using IsSpan = IsSpanImpl>; -+using IsSpan = IsSpanImpl::type>; - - template - struct IsStdArrayImpl : std::false_type {}; -@@ -36,7 +36,7 @@ template - struct IsStdArrayImpl> : std::true_type {}; - - template --using IsStdArray = IsStdArrayImpl>; -+using IsStdArray = IsStdArrayImpl::type>; - - template - using IsLegalSpanConversion = std::is_convertible; diff --git a/chromium.spec b/chromium.spec index 4ae1ecb..14d6ef4 100644 --- a/chromium.spec +++ b/chromium.spec @@ -218,7 +218,7 @@ Patch63: chromium-gn-bootstrap-r17.patch Patch64: chromium-62.0.3202.62-correct-cplusplus-check.patch # epel7 does not know about c++14 Patch65: chromium-62.0.3202.62-epel7-noc++14.patch -Patch66: chromium-62.0.3202.62-epel7-c++11-decay-type.patch +Patch66: chromium-62.0.3202.62-epel7-c++11-decay-enable_if-type.patch ### Chromium Tests Patches ### Patch100: chromium-46.0.2490.86-use_system_opus.patch