Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98da46b7 authored by Yi Kong's avatar Yi Kong Committed by android-build-merger
Browse files

Merge "Silence bogus unused-lambda-capture warning" am: 1aafb843 am: 0a9126f2

am: 6df7cc5d

Change-Id: Ia49f793fd53ccf97d085149a5f144c572c33454f
parents c19a5b83 6df7cc5d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -450,12 +450,19 @@ class Variant {
  Variant(Variant&& other)
      : index_{other.index_}, value_{std::move(other.value_), other.index_} {}

// Recent Clang versions has a regression that produces bogus
// unused-lambda-capture warning. Suppress the warning as a temporary
// workaround. http://b/71356631
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-lambda-capture"
  // Copy and move construction from Variant types. Each element of OtherTypes
  // must be convertible to an element of Types.
  template <typename... OtherTypes>
  explicit Variant(const Variant<OtherTypes...>& other) {
    other.Visit([this](const auto& value) { Construct(value); });
  }
#pragma clang diagnostic pop

  template <typename... OtherTypes>
  explicit Variant(Variant<OtherTypes...>&& other) {
    other.Visit([this](auto&& value) { Construct(std::move(value)); });