Make a string copy explicit
The newest version of gcc seems to flag on patterns like what was
included there, where we implicitly construct a string, then take a
reference to it. So far as I'm aware, this has never caused an issue in
practice, but seems to be undefined behavior.
In a perfect world, I would change the left side of this to match the
input type of const char*, but that would require some interface changes
that I'd like to avoid to keep this change small and self contained
while we try to fix the build.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic1ff16c02f6461894834432ccad285526ae41b3f
diff --git a/src/ExitAirTempSensor.cpp b/src/ExitAirTempSensor.cpp
index feb37ee..ed24155 100644
--- a/src/ExitAirTempSensor.cpp
+++ b/src/ExitAirTempSensor.cpp
@@ -553,7 +553,7 @@
"power", inletTemperatureSensor};
std::weak_ptr<ExitAirTempSensor> weakRef = weak_from_this();
- for (const std::string& type : matchTypes)
+ for (const std::string type : matchTypes)
{
setupSensorMatch(matches, *dbusConnection, type,
[weakRef, type](const double& value,