sdbus++: handle duplicate generated variant types

4ac7e56e8e18202fad3b2734346c6d4c7a6957fc added support for 'size_t'
and 'ssize_t' types to sdbus++.  On some architectures these collide
with '[u]int32_t' or '[u]int64_t' types and so may not be added to a
combined variant (ie. variant<uint32_t, size_t> will fail to compile
on some architectures).  The generated bindings in sdbus++ need a
variant from the set of all properties for some of the constructor
forms.

Create a template type which will formulate a non-duplicative type set
from which a variant can be constructed and modify the sdbus++ generator
to use this variant type instead of std::variant directly.  Added test
cases here to cover this condition for 'size' and 'ssize' sdbus++ types.

It is possible this could have been resolved in the generator itself,
but then the generator would have needed to know which architecture the
generated bindings were going to be compiled for.  This would have made
the header files incompatible between x86-64 and arm32.  I chose instead
to keep the header files consistent across all architectures and let the
compiler make the type decision.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I7db5ad2c32d86d37d920a1801cdabfcaeda89489
diff --git a/test/utility/type_traits.cpp b/test/utility/type_traits.cpp
index 33bf8c1..0a61648 100644
--- a/test/utility/type_traits.cpp
+++ b/test/utility/type_traits.cpp
@@ -1,3 +1,4 @@
+#include <sdbusplus/utility/dedup_variant.hpp>
 #include <sdbusplus/utility/type_traits.hpp>
 
 #include <type_traits>
@@ -82,4 +83,13 @@
     ASSERT_THAT(has_member_contains_v<Bar>, Eq(false));
 }
 
+// Tests for dedup_variant.
+static_assert(std::is_same_v<std::variant<size_t>,
+                             sdbusplus::utility::dedup_variant<size_t>>);
+static_assert(std::is_same_v<std::variant<char, size_t>,
+                             sdbusplus::utility::dedup_variant<char, size_t>>);
+static_assert(std::is_same_v<
+              std::variant<uint32_t, uint64_t>,
+              sdbusplus::utility::dedup_variant<uint32_t, uint64_t, size_t>>);
+
 } // namespace