Remove wpi::ArrayRef std::initializer_list constructor (#1745)

This can be dangerous as it refers to a temporary, and GCC 9.0 warns about
its use.  Instead add std::initializer_list overloads to common places it
was used in an initializer_list sense.
This commit is contained in:
Peter Johnson
2019-06-29 23:54:02 -07:00
committed by GitHub
parent 9e19b29c31
commit 60dce66a4f
17 changed files with 482 additions and 59 deletions

View File

@@ -135,9 +135,8 @@ TEST_F(WebSocketClientTest, ProtocolGood) {
mockProtocol = "myProtocol";
clientPipe->Connect(pipeName, [&] {
auto ws = WebSocket::CreateClient(
*clientPipe, "/test", pipeName,
ArrayRef<StringRef>{"myProtocol", "myProtocol2"});
auto ws = WebSocket::CreateClient(*clientPipe, "/test", pipeName,
{"myProtocol", "myProtocol2"});
ws->closed.connect([&](uint16_t code, StringRef msg) {
Finish();
if (code != 1005 && code != 1006)