test: unpack_properties: add constructor hint
scan-build-14 with GCC-12 seems to be failing with the following
warning:
```
../../../test/unpack_properties.cpp:34:23: error: no matching member function for call to 'emplace'
error.emplace(reason, property);
```
Add a constructor to provide a hint and make scan-build happier.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ie5fa169a9c86e8c221adb5407efb6bef5681c9e0
diff --git a/test/unpack_properties.cpp b/test/unpack_properties.cpp
index 656dc41..b4a3e32 100644
--- a/test/unpack_properties.cpp
+++ b/test/unpack_properties.cpp
@@ -20,6 +20,8 @@
{
struct UnpackError
{
+ UnpackError(sdbusplus::UnpackErrorReason r, const std::string& p) :
+ reason(r), property(p){};
sdbusplus::UnpackErrorReason reason;
std::string property;
};
@@ -29,7 +31,7 @@
{
std::optional<UnpackError> error;
unpackPropertiesNoThrow(
- [&error](const sdbusplus::UnpackErrorReason reason,
+ [&error](sdbusplus::UnpackErrorReason reason,
const std::string& property) {
error.emplace(reason, property);
},