[core] Fix bugprone-forwarding-reference-overload errors in header files

This was a false positive.

As reported by clang-tidy-8.
This commit is contained in:
Thiago Marcos P. Santos
2020-03-27 18:30:35 +02:00
parent 83b43bb38c
commit 09d58c0f86

View File

@@ -96,6 +96,7 @@ class ConversionTraits;
class Convertible {
public:
template <typename T>
// NOLINTNEXTLINE(bugprone-forwarding-reference-overload)
Convertible(T&& value) : vtable(vtableForType<std::decay_t<T>>()) {
static_assert(sizeof(Storage) >= sizeof(std::decay_t<T>), "Storage must be large enough to hold value type");
new (static_cast<void*>(&storage)) std::decay_t<T>(std::forward<T>(value));