Inline trivial constructors
I was investigating a Chromium merge failure where an unused variable triggered a warning in Chromium but not google3: cl/276485378. It appears that in google3 the compiler will only flag unused variables if they are primitive types, or if the struct/class has an inline constexpr constructor. So I performed a quick audit of our code and made the most obvious examples follow this pattern.
gfe-relnote: inline constructors, no behavior change
PiperOrigin-RevId: 276787382
Change-Id: Ib59b54d390b0e89966d2a8ccac2f4d1eaa478893
diff --git a/quic/core/quic_versions.h b/quic/core/quic_versions.h
index 3e34cce..8522c67 100644
--- a/quic/core/quic_versions.h
+++ b/quic/core/quic_versions.h
@@ -134,10 +134,12 @@
HandshakeProtocol handshake_protocol;
QuicTransportVersion transport_version;
- ParsedQuicVersion(HandshakeProtocol handshake_protocol,
- QuicTransportVersion transport_version);
+ constexpr ParsedQuicVersion(HandshakeProtocol handshake_protocol,
+ QuicTransportVersion transport_version)
+ : handshake_protocol(handshake_protocol),
+ transport_version(transport_version) {}
- ParsedQuicVersion(const ParsedQuicVersion& other)
+ constexpr ParsedQuicVersion(const ParsedQuicVersion& other)
: handshake_protocol(other.handshake_protocol),
transport_version(other.transport_version) {}