From 8bbcf80b35f73fe849dd2e958cf22c9d84f01b01 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 30 Dec 2025 10:10:07 +0100 Subject: [PATCH] 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. --- src/pointer_func.hpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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) -- 1.7.1