From: Thomas Jarosch Date: Tue, 30 Dec 2025 09:10:07 +0000 (+0100) Subject: Fix catch-value warning X-Git-Tag: v2.13~1^2~3 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=8bbcf80b35f73fe849dd2e958cf22c9d84f01b01;p=libi2ncommon Fix catch-value warning Original warning: src/pointer_func.hpp:74:27: error: catching polymorphic type 'class boost::bad_weak_ptr' by value [-Werror=catch-value=] Changed both catch statements to catch by reference (const&) instead of by value. --- diff --git a/src/pointer_func.hpp b/src/pointer_func.hpp index dde564b..8251020 100644 --- a/src/pointer_func.hpp +++ b/src/pointer_func.hpp @@ -71,7 +71,7 @@ class SharedBase try { result = shared_from_this(); } - catch (boost::bad_weak_ptr) + catch (const boost::bad_weak_ptr&) { } return result; @@ -94,7 +94,7 @@ class SharedBase try { ptr = shared_from_this(); } - catch (boost::bad_weak_ptr) + catch (const boost::bad_weak_ptr&) { } if (ptr)