From b7ffa6f040d6609fce6f2fef81ee0c3792abc048 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 3 Nov 2023 11:50:52 -0400 Subject: [PATCH] cpp-common/bt2: add `noexcept` to user attribute setters The bt_*_set_user_attributes() functions never fail (they only increment the reference count of the received value), therefore the user attribute setters never throw. Signed-off-by: Philippe Proulx Change-Id: I5b9c05e6efd7b42965b9e075438b518df1a5da90 Reviewed-on: https://review.lttng.org/c/babeltrace/+/11229 Reviewed-by: Simon Marchi --- src/cpp-common/bt2/clock-class.hpp | 2 +- src/cpp-common/bt2/field-class.hpp | 6 +++--- src/cpp-common/bt2/trace-ir.hpp | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cpp-common/bt2/clock-class.hpp b/src/cpp-common/bt2/clock-class.hpp index 398f8197..ce306eef 100644 --- a/src/cpp-common/bt2/clock-class.hpp +++ b/src/cpp-common/bt2/clock-class.hpp @@ -245,7 +245,7 @@ public: } template - void userAttributes(const CommonMapValue userAttrs) const + void userAttributes(const CommonMapValue userAttrs) const noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); diff --git a/src/cpp-common/bt2/field-class.hpp b/src/cpp-common/bt2/field-class.hpp index d382db1d..6682e5b5 100644 --- a/src/cpp-common/bt2/field-class.hpp +++ b/src/cpp-common/bt2/field-class.hpp @@ -421,7 +421,7 @@ public: asVariantWithSignedIntegerSelector() const noexcept; template - void userAttributes(const CommonMapValue userAttrs) const + void userAttributes(const CommonMapValue userAttrs) const noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1039,7 +1039,7 @@ public: } template - void userAttributes(const CommonMapValue userAttrs) const + void userAttributes(const CommonMapValue userAttrs) const noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1913,7 +1913,7 @@ public: } template - void userAttributes(const CommonMapValue userAttrs) const + void userAttributes(const CommonMapValue userAttrs) const noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); diff --git a/src/cpp-common/bt2/trace-ir.hpp b/src/cpp-common/bt2/trace-ir.hpp index 4d058137..1026600e 100644 --- a/src/cpp-common/bt2/trace-ir.hpp +++ b/src/cpp-common/bt2/trace-ir.hpp @@ -505,7 +505,7 @@ public: } template - void userAttributes(const CommonMapValue userAttrs) const + void userAttributes(const CommonMapValue userAttrs) const noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -819,7 +819,7 @@ public: } template - void userAttributes(const CommonMapValue userAttrs) const + void userAttributes(const CommonMapValue userAttrs) const noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1124,7 +1124,7 @@ public: } template - void userAttributes(const CommonMapValue userAttrs) const + void userAttributes(const CommonMapValue userAttrs) const noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1585,7 +1585,7 @@ public: } template - void userAttributes(const CommonMapValue userAttrs) const + void userAttributes(const CommonMapValue userAttrs) const noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2021,7 +2021,7 @@ public: } template - void userAttributes(const CommonMapValue userAttrs) const + void userAttributes(const CommonMapValue userAttrs) const noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); -- 2.34.1