From 8394b21475ccce4f52636cc7dd827c0f0963a4b6 Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Fri, 23 Jan 2026 15:46:27 -0800 Subject: [PATCH] Enable shadow warning for `:bindings_support`. Chrome turns on `-Wshadow`, so we want our support libs to be compliant so we don't cause error in their build. PiperOrigin-RevId: 860285239 --- support/internal/BUILD | 1 + support/internal/slot.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/support/internal/BUILD b/support/internal/BUILD index 15a947227..1c1c60a72 100644 --- a/support/internal/BUILD +++ b/support/internal/BUILD @@ -16,6 +16,7 @@ cc_library( "slot.h", ], compatible_with = ["//buildenv/target:non_prod"], + copts = ["-Wshadow"], visibility = [ "//visibility:public", ], diff --git a/support/internal/slot.h b/support/internal/slot.h index 4374ed6f5..0d219d856 100644 --- a/support/internal/slot.h +++ b/support/internal/slot.h @@ -146,7 +146,7 @@ class Slot> { using T = std::array; Slot() {} explicit constexpr Slot(T&& x) { - if constexpr (requires(UT x) { UT(UnsafeRelocateTag{}, std::move(x)); }) { + if constexpr (requires(UT t) { UT(UnsafeRelocateTag{}, std::move(t)); }) { memcpy(value_.data(), x.data(), sizeof(UT) * S); } else { value_ = std::move(x);