Skip to content

Commit 350a09b

Browse files
committed
[#3991] Suppressed 2 cppcheck complains in optional.h
1 parent a8e7ef6 commit 350a09b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/lib/util/optional.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class Optional {
9696
/// @todo: when C++17 will be required can be solved using "if contexpr"
9797
/// for type convertible from int or default constructible.
9898
/// This will fix complains from code checkers e.g. cppcheck CWE 476.
99+
// cppcheck-suppress nullPointer
99100
Optional()
100101
: default_(T(0)), unspecified_(true) {
101102
}
@@ -116,6 +117,9 @@ class Optional {
116117
/// @brief Retrieves the encapsulated value.
117118
///
118119
/// @return the encapsulated value
120+
///
121+
/// @note Reference types are explicitely excluded.
122+
// cppcheck-suppress returnByReference
119123
T get() const {
120124
return (default_);
121125
}

0 commit comments

Comments
 (0)