)]}'
{
  "commit": "71bfaf6800771be5fcc90a6c069cc0d1cae8d166",
  "tree": "388a184094676d8867a584848e87192e6edfa419",
  "parents": [
    "bf3a11997dbcbc6fc44924ec515fcfc582588d45"
  ],
  "author": {
    "name": "bnc",
    "email": "bnc@google.com",
    "time": "Fri May 13 05:39:08 2022 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Fri May 13 05:41:13 2022 -0700"
  },
  "message": "Add using directives to BalsaHeader to fix gcc compile error.\n\nThree ConstHeaderApi virtual methods each have two overloads that only differ in\na single argument type: absl::string_view versus QuicheLowerCaseString.  In\nEnvoy, QuicheLowerCaseString is an alias to Envoy::Http::LowerCaseString [1],\nwhich has an implicit conversion operator to absl::string_view [2].\n\n[1]\nhttps://github.com/envoyproxy/envoy/blob/741b8c08d3de1650fc45d5c9a75e418867a10fa9/source/common/quic/platform/quiche_lower_case_string_impl.h#L13\n[2]\nhttps://github.com/envoyproxy/envoy/blob/741b8c08d3de1650fc45d5c9a75e418867a10fa9/envoy/http/header_map.h#L82-L83\n\nConstHeaderApi provides a trivial definition to the QuicheLowerCaseString\noverload that calls the absl::string_view overload, which is overridden in\nBalsaHeaders.  This makes perfect sense but makes gcc in Envoy unhappy:\n\nquiche/common/balsa/header_api.h:89:23: error:\n‘virtual std::string quiche::ConstHeaderApi::GetAllOfHeaderAsString(const QuicheLowerCaseString\u0026) const’ was hidden [-Werror\u003doverloaded-virtual]\nquiche/common/balsa/balsa_headers.h:560:15: error:\nby ‘virtual std::string quiche::BalsaHeaders::GetAllOfHeaderAsString(absl::string_view) const’ [-Werror\u003doverloaded-virtual]\n\nThis is because when called with a QuicheLowerCaseString argument on a\nBalsaHeaders object, the latter overload is preferred over the former (due to\nthe implicit conversion), which is not the intended behavior.\n\nGetAllOfHeader() does not pose an issue due to the\n  using HeaderApi::GetAllOfHeader;\ndirective at balsa_headers.h:549.\n\nThis CL adds similar using directives to the other two methods to solve this\nproblem.\n\nAnd here is a minimal example to verify this behavior.  Running with\ngcc a.cc -Woverloaded-virtual -l:libstdc++.a \u0026\u0026 ./a.out\nprints \"right\" and no warning, but if the using directive is removed, the\nwarning appears and \"wrong\" is printed:\n\n#include \u003ciostream\u003e\n\nclass T {\n public:\n  operator int() const { return 0; }\n};\n\nclass base {\n public:\n  virtual void print(int a) \u003d 0;\n  virtual void print(T a) { std::cout \u003c\u003c \"right\" \u003c\u003c std::endl; }\n};\n\nclass derived : public base {\n public:\n  using base::print;\n  void print(int a) override { std::cout \u003c\u003c \"wrong\" \u003c\u003c std::endl; }\n};\n\nint main() {\n  T t;\n  derived c;\n  c.print(t);\n  return 0;\n}\n\nPiperOrigin-RevId: 448474666\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ad51cb8570717c1ce9ea5063190500d5090e1e47",
      "old_mode": 33188,
      "old_path": "quiche/balsa/balsa_headers.h",
      "new_id": "9302dad9904ed0677c97dd6a33e398bcfdb00b27",
      "new_mode": 33188,
      "new_path": "quiche/balsa/balsa_headers.h"
    }
  ]
}
