Commit 0479ef6e authored by Camille Lamy's avatar Camille Lamy Committed by Commit Bot

Revert "GCC: Fix base::internal::InvokeFuncImpl"

This reverts commit 9293d5c8.

Reason for revert: this is breaking compilation on linux-builder-perf.
https://ci.chromium.org/p/chrome/builders/ci/linux-builder-perf/120938

Original change's description:
> GCC: Fix base::internal::InvokeFuncImpl
> 
> GCC doesn't like that the Value data member has no out-of-line
> definition. The problem is triggered specifically only when compiling
> 
>   components/services/leveldb/leveldb_database_impl.cc
> 
> which has lambda functions returning locally-defined classes.
> 
> The current code works as-is in C++17 mode which introduces the concept
> of inline variables, but in C++14 we need either an explicit out-of-line
> definition or a function member instead of a data member.
> 
> Use std::integral_constant for defining the value.
> 
> Bug: 819294
> Change-Id: I5c68e14ce3fa9d8b4d8a2cb42d7f9b53938aabf3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862451
> Reviewed-by: Jan Wilken Dörrie <jdoerrie@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Jüri Valdmann <juri.valdmann@qt.io>
> Cr-Commit-Position: refs/heads/master@{#706384}

TBR=dcheng@chromium.org,jdoerrie@chromium.org,juri.valdmann@qt.io

Change-Id: I14e3e77219874f186fb04d63ee657630e8ee73fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 819294
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864782Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706409}
parent c0bb1a4c
...@@ -191,12 +191,14 @@ template <bool is_once, typename Invoker> ...@@ -191,12 +191,14 @@ template <bool is_once, typename Invoker>
struct InvokeFuncImpl; struct InvokeFuncImpl;
template <typename Invoker> template <typename Invoker>
struct InvokeFuncImpl<true, Invoker> struct InvokeFuncImpl<true, Invoker> {
: std::integral_constant<decltype(&Invoker::RunOnce), &Invoker::RunOnce> {}; static constexpr auto Value = &Invoker::RunOnce;
};
template <typename Invoker> template <typename Invoker>
struct InvokeFuncImpl<false, Invoker> struct InvokeFuncImpl<false, Invoker> {
: std::integral_constant<decltype(&Invoker::Run), &Invoker::Run> {}; static constexpr auto Value = &Invoker::Run;
};
template <template <typename> class CallbackT, template <template <typename> class CallbackT,
typename Functor, typename Functor,
...@@ -227,7 +229,7 @@ decltype(auto) BindImpl(Functor&& functor, Args&&... args) { ...@@ -227,7 +229,7 @@ decltype(auto) BindImpl(Functor&& functor, Args&&... args) {
// InvokeFuncStorage, so that we can ensure its type matches to // InvokeFuncStorage, so that we can ensure its type matches to
// PolymorphicInvoke, to which CallbackType will cast back. // PolymorphicInvoke, to which CallbackType will cast back.
using PolymorphicInvoke = typename CallbackType::PolymorphicInvoke; using PolymorphicInvoke = typename CallbackType::PolymorphicInvoke;
PolymorphicInvoke invoke_func = InvokeFuncImpl<kIsOnce, Invoker>::value; PolymorphicInvoke invoke_func = InvokeFuncImpl<kIsOnce, Invoker>::Value;
using InvokeFuncStorage = internal::BindStateBase::InvokeFuncStorage; using InvokeFuncStorage = internal::BindStateBase::InvokeFuncStorage;
return CallbackType(BindState::Create( return CallbackType(BindState::Create(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment