aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.com>2025-02-08 09:52:09 +0300
committerbabenko <babenko@yandex-team.com>2025-02-08 10:13:16 +0300
commit8b0c83f49140c69ea6f63dd5a8a06118850a6d05 (patch)
tree1e8ae2fc0e2fe8f768f3704bda0b46028965780b
parentd9df35e416f5b61c3709ad05dafe08ac1d4f17aa (diff)
downloadydb-8b0c83f49140c69ea6f63dd5a8a06118850a6d05.tar.gz
Fix compling (and linking) TYsonStructFinalClassHolder with MSVC
commit_hash:68342023b1437649fbd1fdb65df61fa73e38948f
-rw-r--r--yt/yt/core/ytree/yson_struct.cpp15
-rw-r--r--yt/yt/core/ytree/yson_struct.h7
2 files changed, 17 insertions, 5 deletions
diff --git a/yt/yt/core/ytree/yson_struct.cpp b/yt/yt/core/ytree/yson_struct.cpp
index 53b875c2e7..42983a33a9 100644
--- a/yt/yt/core/ytree/yson_struct.cpp
+++ b/yt/yt/core/ytree/yson_struct.cpp
@@ -7,6 +7,8 @@
#include <util/generic/algorithm.h>
+#include <util/system/platform.h>
+
namespace NYT::NYTree {
using namespace NYPath;
@@ -18,6 +20,19 @@ TYsonStructFinalClassHolder::TYsonStructFinalClassHolder(std::type_index typeInd
: FinalType_(typeIndex)
{ }
+#ifdef _win_
+
+// This constructor is not actually called.
+// This dummy implementation is only provided for MSVC
+// as the latter fails to link the binary in debug mode unless it is implemented.
+// If we just delete it, the default constructor of TYsonStructLite
+// will be implicitly deleted as well and compilation will fail.
+TYsonStructFinalClassHolder::TYsonStructFinalClassHolder()
+ : FinalType_{typeid(void)}
+{ }
+
+#endif
+
////////////////////////////////////////////////////////////////////////////////
TYsonStructBase::TYsonStructBase()
diff --git a/yt/yt/core/ytree/yson_struct.h b/yt/yt/core/ytree/yson_struct.h
index 4d917baf7a..84be291e8f 100644
--- a/yt/yt/core/ytree/yson_struct.h
+++ b/yt/yt/core/ytree/yson_struct.h
@@ -162,13 +162,10 @@ private:
class TYsonStructFinalClassHolder
{
protected:
- explicit TYsonStructFinalClassHolder(std::type_index typeIndex);
+ std::type_index FinalType_;
- // This constructor is only declared but not defined as it never is called.
- // If we delete it default constructor of TYsonStructLite will be implicitly deleted as well and compilation will fail.
+ explicit TYsonStructFinalClassHolder(std::type_index typeIndex);
TYsonStructFinalClassHolder();
-
- std::type_index FinalType_;
};
////////////////////////////////////////////////////////////////////////////////