Do not use inline constexpr variables in http2/adapter/http2_protocol.h.
This does not compile in Chromium:
error: inline variables are a C++17 extension [-Werror,-Wc++17-extensions]
Unfortunately adding -Wc++17-extensions to the build file does not actually turn
this into an error in Google3.
PiperOrigin-RevId: 389231446
diff --git a/http2/adapter/http2_protocol.cc b/http2/adapter/http2_protocol.cc
index 8d59aee..dc0a57a 100644
--- a/http2/adapter/http2_protocol.cc
+++ b/http2/adapter/http2_protocol.cc
@@ -12,6 +12,10 @@
const char kHttp2PathPseudoHeader[] = ":path";
const char kHttp2StatusPseudoHeader[] = ":status";
+const uint8_t kMetadataFrameType = 0x4d;
+const uint8_t kMetadataEndFlag = 0x04;
+const uint16_t kMetadataExtensionId = 0x4d44;
+
std::pair<absl::string_view, bool> GetStringView(const HeaderRep& rep) {
if (absl::holds_alternative<absl::string_view>(rep)) {
return std::make_pair(absl::get<absl::string_view>(rep), true);
diff --git a/http2/adapter/http2_protocol.h b/http2/adapter/http2_protocol.h
index 5e892e0..9f72fbe 100644
--- a/http2/adapter/http2_protocol.h
+++ b/http2/adapter/http2_protocol.h
@@ -67,6 +67,11 @@
ABSL_CONST_INIT QUICHE_EXPORT_PRIVATE extern const char
kHttp2StatusPseudoHeader[];
+ABSL_CONST_INIT QUICHE_EXPORT_PRIVATE extern const uint8_t kMetadataFrameType;
+ABSL_CONST_INIT QUICHE_EXPORT_PRIVATE extern const uint8_t kMetadataEndFlag;
+ABSL_CONST_INIT QUICHE_EXPORT_PRIVATE extern const uint16_t
+ kMetadataExtensionId;
+
enum class FrameType : uint8_t {
DATA = 0x0,
HEADERS,
@@ -131,10 +136,6 @@
kServer,
};
-inline constexpr uint8_t kMetadataFrameType = 0x4d;
-inline constexpr uint8_t kMetadataEndFlag = 0x04;
-inline constexpr uint16_t kMetadataExtensionId = 0x4d44;
-
} // namespace adapter
} // namespace http2