Makes `SpdyAcceptChIR` single-argument constructor `explicit`. Marks the `SpdyAcceptChIR(std::vector<AcceptChOriginValuePair>)` constructor as `explicit` and explicitly initializes `AcceptChOriginValuePair` in `spdy_protocol_test` to resolve ambiguous constructor overload resolution in newer Clang versions (e.g., clang-22 on Linux). PiperOrigin-RevId: 982552227
diff --git a/quiche/http2/core/spdy_protocol.h b/quiche/http2/core/spdy_protocol.h index d074786..c6a752f 100644 --- a/quiche/http2/core/spdy_protocol.h +++ b/quiche/http2/core/spdy_protocol.h
@@ -1277,7 +1277,7 @@ class QUICHE_EXPORT SpdyAcceptChIR : public SpdyFrameIR { public: - SpdyAcceptChIR(std::vector<AcceptChOriginValuePair> entries) + explicit SpdyAcceptChIR(std::vector<AcceptChOriginValuePair> entries) : entries_(std::move(entries)) {} SpdyAcceptChIR(const SpdyAcceptChIR&) = delete; SpdyAcceptChIR& operator=(const SpdyAcceptChIR&) = delete;
diff --git a/quiche/http2/core/spdy_protocol_test.cc b/quiche/http2/core/spdy_protocol_test.cc index 82100e3..82328c7 100644 --- a/quiche/http2/core/spdy_protocol_test.cc +++ b/quiche/http2/core/spdy_protocol_test.cc
@@ -261,7 +261,7 @@ // short to trigger the move optimization, and instead a copy occurs. std::string baz = "the quick brown fox"; SpdyDataIR d5(/* stream_id = */ 5, std::move(baz)); - EXPECT_EQ("", baz); + EXPECT_EQ("", baz); // NOLINT(bugprone-use-after-move) EXPECT_EQ(absl::string_view(d5.data(), d5.data_len()), "the quick brown fox"); // Confirms makes a copy of string literal. @@ -646,7 +646,8 @@ EXPECT_TRUE(SerializeFrame(accept_ch, builder)); SpdySerializedFrame serialized = builder.take(); - SpdyAcceptChIR accept_ch_ir({{"example.com", "sec-ch-ua"}}); + SpdyAcceptChIR accept_ch_ir( + {AcceptChOriginValuePair{.origin = "example.com", .value = "sec-ch-ua"}}); SpdySerializedFrame expected = framer.SerializeAcceptCh(accept_ch_ir); EXPECT_EQ(absl::string_view(expected), absl::string_view(serialized));