]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3991] Suppressed 2 cppcheck complains in optional.h
authorFrancis Dupont <fdupont@isc.org>
Wed, 27 May 2026 14:59:58 +0000 (16:59 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 27 May 2026 20:03:02 +0000 (22:03 +0200)
src/lib/util/optional.h

index a9cea63343078b6855985b512109a0738e9c6ebf..1376642a463c268317d505c9f57343b6f6d6c388 100644 (file)
@@ -96,6 +96,7 @@ public:
     /// @todo: when C++17 will be required can be solved using "if contexpr"
     /// for type convertible from int or default constructible.
     /// This will fix complains from code checkers e.g. cppcheck CWE 476.
+    // cppcheck-suppress nullPointer
     Optional()
         : default_(T(0)), unspecified_(true) {
     }
@@ -116,6 +117,9 @@ public:
     /// @brief Retrieves the encapsulated value.
     ///
     /// @return the encapsulated value
+    ///
+    /// @note Reference types are explicitely excluded.
+    // cppcheck-suppress returnByReference
     T get() const {
         return (default_);
     }