From 6531dfeacdac334a74e3087866dff73feb4f83bf Mon Sep 17 00:00:00 2001 From: Benjamin Bihler Date: Tue, 21 Jul 2020 13:37:03 +0200 Subject: [PATCH] 0031680: Configuration - Compilation Fails With G++ 10.1, LD 2.34 and Link-Time Optimization Added a non-inline empty virtual destructor to LDOM_OSStream to force vtable generation in one translation unit only. --- src/LDOM/LDOM_OSStream.cxx | 8 ++++++++ src/LDOM/LDOM_OSStream.hxx | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/LDOM/LDOM_OSStream.cxx b/src/LDOM/LDOM_OSStream.cxx index f19741d16e..4734721346 100644 --- a/src/LDOM/LDOM_OSStream.cxx +++ b/src/LDOM/LDOM_OSStream.cxx @@ -161,3 +161,11 @@ LDOM_OSStream::LDOM_OSStream (const Standard_Integer theMaxBuf) { init(&myBuffer); } + +//======================================================================= +//function : ~LDOM_OSStream() +//purpose : Destructor - for g++ vtable generation in *this* translation unit +//======================================================================= +LDOM_OSStream::~LDOM_OSStream() +{ +} diff --git a/src/LDOM/LDOM_OSStream.hxx b/src/LDOM/LDOM_OSStream.hxx index 63330db1bb..e3f88a5a2d 100644 --- a/src/LDOM/LDOM_OSStream.hxx +++ b/src/LDOM/LDOM_OSStream.hxx @@ -102,6 +102,8 @@ public: //! Constructor Standard_EXPORT LDOM_OSStream(const Standard_Integer theMaxBuf); + Standard_EXPORT virtual ~LDOM_OSStream(); + Standard_CString str () const {return myBuffer.str();} Standard_Integer Length () const { return myBuffer.Length(); }