Commit 7cd0ea1c authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

[Promises] Drop constexpr from unique_any/any_internal's operator=

This fixes the GCC build:

    ../../base/containers/any_internal.h: In member function ‘constexpr void base::internal::AnyInternal::operator=(base::internal::AnyInternal&&)’:
    ../../base/containers/any_internal.h:42:10: error: call to non-‘constexpr’ function ‘void base::internal::AnyInternal::reset()’
         reset();
         ~~~~~^~

reset() itself is not constexpr, and it is not clear if it should be given
it calls |delete_fn_ptr|.

Bug: 819294, 906125
Change-Id: I7760c62213db0e59a82e5210988ee469b5006090
Reviewed-on: https://chromium-review.googlesource.com/c/1458096
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630029}
parent bc2dd26d
...@@ -38,7 +38,7 @@ class BASE_EXPORT AnyInternal { ...@@ -38,7 +38,7 @@ class BASE_EXPORT AnyInternal {
constexpr explicit AnyInternal(const TypeOps* type_ops) constexpr explicit AnyInternal(const TypeOps* type_ops)
: type_ops_(type_ops), union_({}) {} : type_ops_(type_ops), union_({}) {}
constexpr void operator=(AnyInternal&& other) noexcept { void operator=(AnyInternal&& other) noexcept {
reset(); reset();
if (other.type_ops_) if (other.type_ops_)
other.type_ops_->move_fn_ptr(&other, this); other.type_ops_->move_fn_ptr(&other, this);
......
...@@ -229,7 +229,7 @@ class BASE_EXPORT unique_any { ...@@ -229,7 +229,7 @@ class BASE_EXPORT unique_any {
return *this; return *this;
} }
constexpr unique_any& operator=(unique_any&& other) noexcept { unique_any& operator=(unique_any&& other) noexcept {
internal_ = std::move(other.internal_); internal_ = std::move(other.internal_);
return *this; return *this;
} }
......
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