From 125da11c6fc11fb0e38e8b8167c1ee4480ddeca4 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 8 Apr 2026 07:57:24 -0400 Subject: [PATCH] MT#64469 catch exception by reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: AmUtils.cpp: In function ‘bool str2int(const std::string&, double&)’: AmUtils.cpp:286:21: warning: catching polymorphic type ‘const class std::invalid_argument’ by value [-Wcatch-value=] 286 | catch (const std::invalid_argument) | ^~~~~~~~~~~~~~~~ AmUtils.cpp:290:21: warning: catching polymorphic type ‘const class std::out_of_range’ by value [-Wcatch-value=] 290 | catch (const std::out_of_range) | ^~~~~~~~~~~~ Change-Id: I3d112aff65ea6e90803b6be7c138227a36975d9f --- core/AmUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/AmUtils.cpp b/core/AmUtils.cpp index 9ced0464..1297e17b 100644 --- a/core/AmUtils.cpp +++ b/core/AmUtils.cpp @@ -280,11 +280,11 @@ bool str2int(const string& str, double& result) return true; } - catch (const std::invalid_argument) + catch (const std::invalid_argument&) { return false; } - catch (const std::out_of_range) + catch (const std::out_of_range&) { return false; }