Fix unused libc++ struct variable warnings in google3-SoT `//third_party` packages. More info at go/libcxx-unused-struct-lsc LLVM libc++ was updated ([commit](https://github.com/llvm/llvm-project/commit/ab8b037ef7b398aa864959a69f328fa69b567f74)) to emit unused-variable warnings for unused libc++ containers and strings, which fail the build under `-Werror` in google3 once `_LIBCPP_DISABLE_UNUSED_STRUCT_WARNINGS` is removed (b/543446945). Removes unused side-effect-free declarations, annotates side-effecting or macro-bound declarations with `[[maybe_unused]]`, and fixes 2 related `-Wunused-{result,but-set-variable}` sites across 399 files in 88 google3-SoT `//third_party` packages (plus 9 Google-only wrapper/test files outside Copybara consistency) uncovered by TAP Train and isolated TGPs #1, #2 (`OCL:1026661282:BASE:1027422407:1795329747713:c5e683c0`), and #3 (`OCL:1026661282:BASE:1027665857:1795375410077:2ed77d8f`). Upstream-SoT `//third_party` packages were split out into unmailed reference CL cl/1033941958 (116 files) with matching `BUILD`/`.bzl` warning suppressions in cl/1033952168; 6 first-party files under `*/third_party/*` subdirectories were split out into cl/1033973972 so `manage_cl` accepts this CL as pure `//third_party/...`. * * * <details> <summary>AI-generation audit log</summary> | CL attribute | Audit log | | :--- | :--- | | Model* | Gemini | | CL diff | AI-generated with 5 iterations | | Key human prompts (verbatim, limited to 5 total) | 1. **Decision:** Keep google3-SoT `//third_party` fixes in cl/1027439455 and split upstream-SoT files into cl/1033941958 and BUILD/`.bzl` suppressions in cl/1033952168. | : : - "split the third party CL as follows\: - keep third-party code that is likely to take changes in google3 in cl/1027439455 - Create a separate CL with the code fixes for which SoT is likely upstream (not for mailing out for review) - For this separate CL, create another CL that suppresses warnings in BUILD / bzl files for unused variables instead of making the code changes." : : : 2. **Decision\:** Queue cl/1027439455 into Rosie pool `manage_cl\:1007350787` (required moving 6 non-`//third_party/...` files out into cl/1033973972). : : : - "Start a manage-cl on cl/1027439455 and add it to the pool at http\://automated-changes/pool/manage_cl\:1007350787" : | CL description | AI-generated using http://depot/configs/users/ninachen/_agents/skills/cl-descriptions/SKILL.md | | Description contains why | ✅ yes | | "Why" provided by | AI | | AI inferred "why" from | b/543446945 and go/libcxx-unused-struct-lsc | *Warning: Model name could be hallucinated. Seems accurate most of the time but not 100%.* </details> Tested: TAP --sample ran all affected tests and none failed http://test/OCL:1033975767:BASE:1033814456:1796173302017:96f60d94 PiperOrigin-RevId: 1034922370
diff --git a/quiche/balsa/balsa_frame_test.cc b/quiche/balsa/balsa_frame_test.cc index 7ea0e71..39f876f 100644 --- a/quiche/balsa/balsa_frame_test.cc +++ b/quiche/balsa/balsa_frame_test.cc
@@ -1982,10 +1982,6 @@ std::string chunks = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\r\n" // should overflow "0\r\n"; - std::string trailer = - "crass: monkeys\r\n" - "funky: monkeys\r\n" - "\n"; ASSERT_EQ(headers.size(), balsa_frame_.ProcessInput(headers.data(), headers.size())); @@ -2035,10 +2031,6 @@ std::string chunks = "555\xAB\r\n" // Character overflowing 7 bits, see b/20238315 "0\r\n"; - std::string trailer = - "crass: monkeys\r\n" - "funky: monkeys\r\n" - "\n"; FakeHeaders fake_headers; fake_headers.AddKeyValue("Connection", "close"); @@ -2074,10 +2066,6 @@ std::string chunks = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\r\n" // should overflow "0\r\n"; - std::string trailer = - "crass: monkeys\r\n" - "funky: monkeys\r\n" - "\n"; const char* chunk_read_before_overflow = "FFFFFFFFFFFFFFFFF"; @@ -2116,10 +2104,6 @@ std::string chunks = "12z123 \r\n" // invalid chunk length "0\r\n"; - std::string trailer = - "crass: monkeys\r\n" - "funky: monkeys\r\n" - "\n"; FakeHeaders fake_headers; fake_headers.AddKeyValue("Connection", "close");
diff --git a/quiche/balsa/balsa_headers_test.cc b/quiche/balsa/balsa_headers_test.cc index 1404c07..95d5109 100644 --- a/quiche/balsa/balsa_headers_test.cc +++ b/quiche/balsa/balsa_headers_test.cc
@@ -162,7 +162,6 @@ Write(data2, nullptr); std::string data3 = "6789"; Write(data3, nullptr); - std::string data4 = "123456789012345"; Write(data3, nullptr); ptr->CopyFrom(*buffer_); @@ -188,7 +187,6 @@ Write(data2, nullptr); std::string data3 = "6789"; Write(data3, nullptr); - std::string data4 = "123456789012345"; Write(data3, nullptr); buffer_->Clear(); @@ -208,7 +206,6 @@ Write(data2, nullptr); std::string data3 = "6789"; Write(data3, nullptr); - std::string data4 = "123456789012345"; Write(data3, nullptr); buffer_->Clear(); @@ -2829,8 +2826,6 @@ { int first = iteration / std::size(response_reason_phrases); const char* response_reason_phrase_first = response_reason_phrases[first]; - std::string expected_new_firstline = - absl::StrFormat("HTTP/1.0 200 %s", response_reason_phrase_first); SCOPED_TRACE(absl::StrFormat("Then set response_reason_phrase(\"%s\")", response_reason_phrase_first)); @@ -2852,8 +2847,6 @@ int second = iteration % std::size(response_reason_phrases); const char* response_reason_phrase_second = response_reason_phrases[second]; - std::string expected_new_firstline = - absl::StrFormat("HTTP/1.0 200 %s", response_reason_phrase_second); SCOPED_TRACE(absl::StrFormat("Then set response_reason_phrase(\"%s\")", response_reason_phrase_second));
diff --git a/quiche/http2/adapter/oghttp2_adapter_test.cc b/quiche/http2/adapter/oghttp2_adapter_test.cc index be9793e..e1b4691 100644 --- a/quiche/http2/adapter/oghttp2_adapter_test.cc +++ b/quiche/http2/adapter/oghttp2_adapter_test.cc
@@ -4341,7 +4341,6 @@ options.perspective = Perspective::kServer; auto adapter = OgHttp2Adapter::Create(visitor, options); - const std::string data_chunk(kDefaultFramePayloadSizeLimit, 'a'); const std::string request = TestFrameSequence() .ClientPreface() @@ -4402,7 +4401,6 @@ options.perspective = Perspective::kServer; auto adapter = OgHttp2Adapter::Create(visitor, options); - const std::string data_chunk(kDefaultFramePayloadSizeLimit, 'a'); const std::string request = TestFrameSequence() .ClientPreface()
diff --git a/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc b/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc index fb61e5f..2e890d0 100644 --- a/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc +++ b/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc
@@ -287,7 +287,7 @@ for (uint64_t value : values) { EncodeNoRandom(value, prefix_length); - std::string dump = quiche::QuicheTextUtils::HexDump(buffer_); + [[maybe_unused]] std::string dump = quiche::QuicheTextUtils::HexDump(buffer_); QUICHE_LOG(INFO) << absl::StrFormat("%10llu %0#18x ", value, value) << quiche::QuicheTextUtils::HexDump(buffer_).substr(7); }
diff --git a/quiche/oblivious_http/buffers/oblivious_http_request.cc b/quiche/oblivious_http/buffers/oblivious_http_request.cc index 6981b44..3fb37b3 100644 --- a/quiche/oblivious_http/buffers/oblivious_http_request.cc +++ b/quiche/oblivious_http/buffers/oblivious_http_request.cc
@@ -261,7 +261,6 @@ Context& context, absl::string_view encrypted_chunk, bool is_final_chunk) { uint8_t* ad = nullptr; size_t ad_len = 0; - std::string final_ad_bytes; if (is_final_chunk) { ad = const_cast<uint8_t*>(kFinalAdBytes); ad_len = sizeof(kFinalAdBytes);
diff --git a/quiche/oblivious_http/buffers/oblivious_http_request_test.cc b/quiche/oblivious_http/buffers/oblivious_http_request_test.cc index 3b97655..5dd2465 100644 --- a/quiche/oblivious_http/buffers/oblivious_http_request_test.cc +++ b/quiche/oblivious_http/buffers/oblivious_http_request_test.cc
@@ -237,7 +237,6 @@ // Encrypted chunks from // https://www.ietf.org/archive/id/draft-ietf-ohai-chunked-ohttp-05.html#appendix-A - std::string decrypted_payload = ""; // Last byte altered to make the chunk invalid. std::string encrypted_chunk = "2ad24942d4d692563012f2980c8fef437a336b9b2fc938ef77a5834e";
diff --git a/quiche/quic/core/crypto/quic_crypto_server_config_test.cc b/quiche/quic/core/crypto/quic_crypto_server_config_test.cc index 16c5091..9f6e26e 100644 --- a/quiche/quic/core/crypto/quic_crypto_server_config_test.cc +++ b/quiche/quic/core/crypto/quic_crypto_server_config_test.cc
@@ -76,7 +76,7 @@ quiche::QuicheReferenceCountedPointer<ProofSource::Chain> chain( new ProofSource::Chain(certs)); - std::string compressed = QuicCryptoServerConfigPeer::CompressChain( + [[maybe_unused]] std::string compressed = QuicCryptoServerConfigPeer::CompressChain( &compressed_certs_cache, chain, ""); EXPECT_EQ(compressed_certs_cache.Size(), 1u); @@ -126,7 +126,7 @@ new ProofSource::Chain(certs)); std::string cached_certs = ""; - std::string compressed = QuicCryptoServerConfigPeer::CompressChain( + [[maybe_unused]] std::string compressed = QuicCryptoServerConfigPeer::CompressChain( &compressed_certs_cache, chain, cached_certs); EXPECT_EQ(compressed_certs_cache.Size(), 1u); @@ -134,7 +134,7 @@ quiche::QuicheReferenceCountedPointer<ProofSource::Chain> chain2( new ProofSource::Chain(certs)); - std::string compressed2 = QuicCryptoServerConfigPeer::CompressChain( + [[maybe_unused]] std::string compressed2 = QuicCryptoServerConfigPeer::CompressChain( &compressed_certs_cache, chain2, cached_certs); EXPECT_EQ(compressed_certs_cache.Size(), 2u); }
diff --git a/quiche/quic/core/http/end_to_end_test.cc b/quiche/quic/core/http/end_to_end_test.cc index 0693d31..44708de 100644 --- a/quiche/quic/core/http/end_to_end_test.cc +++ b/quiche/quic/core/http/end_to_end_test.cc
@@ -9315,7 +9315,7 @@ memory_cache_backend_.AddResponse(server_hostname_, "/eep", std::move(headers), "", trailers.Clone()); - std::string received_response = client_->SendSynchronousRequest("/eep"); + [[maybe_unused]] std::string received_response = client_->SendSynchronousRequest("/eep"); EXPECT_THAT(client_->stream_error(), IsStreamError(QUIC_BAD_APPLICATION_PAYLOAD)); }
diff --git a/quiche/quic/core/http/quic_spdy_stream_test.cc b/quiche/quic/core/http/quic_spdy_stream_test.cc index 1cb7bf5..8a723d7 100644 --- a/quiche/quic/core/http/quic_spdy_stream_test.cc +++ b/quiche/quic/core/http/quic_spdy_stream_test.cc
@@ -713,7 +713,6 @@ TEST_P(QuicSpdyStreamTest, MarkHeadersConsumed) { Initialize(kShouldProcessData); - std::string body = "this is the body"; QuicHeaderList headers = ProcessHeaders(false, headers_); EXPECT_EQ(headers, stream_->header_list());
diff --git a/quiche/quic/masque/masque_ohttp_client.cc b/quiche/quic/masque/masque_ohttp_client.cc index c40c7f2..a512ca9 100644 --- a/quiche/quic/masque/masque_ohttp_client.cc +++ b/quiche/quic/masque/masque_ohttp_client.cc
@@ -856,7 +856,7 @@ absl::StrCat("Failed to parse URL ", per_request_config.url())); } Message request; - std::string post_data = per_request_config.post_data(); + [[maybe_unused]] std::string post_data = per_request_config.post_data(); request.headers[":method"] = per_request_config.method(); request.headers[":scheme"] = url.scheme(); request.headers[":authority"] = url.HostPort();