From 96f471e0224e6e19dc05af18d178f1eb0fc858ae Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Wed, 27 Dec 2017 14:08:51 -0800 Subject: Silence bogus unused-lambda-capture warning Workaround for upstream Clang bug to fix Werror build. Bug: 71356631 Test: Build Change-Id: I4a3a2fa5aaee4fc2e981478c34fe7ac53eb8c928 --- libs/vr/libpdx/private/pdx/rpc/variant.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs') diff --git a/libs/vr/libpdx/private/pdx/rpc/variant.h b/libs/vr/libpdx/private/pdx/rpc/variant.h index 80b17694ce..2cc96645e2 100644 --- a/libs/vr/libpdx/private/pdx/rpc/variant.h +++ b/libs/vr/libpdx/private/pdx/rpc/variant.h @@ -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 explicit Variant(const Variant& other) { other.Visit([this](const auto& value) { Construct(value); }); } +#pragma clang diagnostic pop + template explicit Variant(Variant&& other) { other.Visit([this](auto&& value) { Construct(std::move(value)); }); -- cgit v1.2.3