Skip to content

Commit

Permalink
Qualify all ambiguous references to folly::Optional
Browse files Browse the repository at this point in the history
Summary:
Having the lines `using namespace testing;` and `using namespace folly;` or `using folly::Optional;` causes a build error with the new googletest version because of `testing::Optional` being a new symbol from googletest

## How I made this diff:
From the list of files

  [rquitt@devbig013.ftw5 ~/fbsource/fbcode/scripts/rquitt] grep -r "'Optional' is ambiguous" | sed 's/stderr: //' | cut -d ':' -f 2 | sort -u
  admarket/adreview/video_understanding/server/test/VusMothershipManagerTest.cpp
  admarket/adreview/video_understanding/server/test/VusTaskManagerTest.cpp
  archive_service/blockio/SdcLogicalBlockWriterTest.cpp
  ...

Open all the files in Vim and use a command like: `:%s/[^y/:]Optional/folly::Optional/`
Also removed all the `using folly::Optional;` lines to discourage further use of ambiguous `Optional` before googletest change is landed.

The alternative to this diff would be to not export `testing::Optional` from googletest.

Reviewed By: igorsugak

Differential Revision: D26358560

fbshipit-source-id: ae8695b3525bf333758b012adcfe944383777625
  • Loading branch information
Robert Quitt authored and facebook-github-bot committed Feb 10, 2021
1 parent 3eda664 commit 4cb97e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quic/server/test/QuicServerTransportTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ class FakeServerHandshake : public FizzServerHandshake {
}
}

Optional<ClientTransportParameters> getClientTransportParams() override {
folly::Optional<ClientTransportParameters> getClientTransportParams()
override {
std::vector<TransportParameter> transportParams;
transportParams.push_back(encodeIntegerParameter(
TransportParameterId::initial_max_stream_data_bidi_local,
Expand Down

0 comments on commit 4cb97e5

Please sign in to comment.