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

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -44,7 +44,6 @@ void RecordingController::AddEventMarker(
DriverStation::ReportError("Shuffleboard event name was not specified");
return;
}
auto arr = wpi::ArrayRef<std::string>{
description, ShuffleboardEventImportanceName(importance)};
m_eventsTable->GetSubTable(name)->GetEntry("Info").SetStringArray(arr);
m_eventsTable->GetSubTable(name)->GetEntry("Info").SetStringArray(
{description, ShuffleboardEventImportanceName(importance)});
}