diff --git a/base/include/android-base/expected.h b/base/include/android-base/expected.h index 38f0d6f2b..9470344e8 100644 --- a/base/include/android-base/expected.h +++ b/base/include/android-base/expected.h @@ -182,7 +182,7 @@ class _NODISCARD_ expected { !std::is_same_v, std::remove_cv_t>> && std::is_convertible_v /* non-explicit */ )> - // NOLINTNEXTLINE(google-explicit-constructor) + // NOLINTNEXTLINE(google-explicit-constructor,bugprone-forwarding-reference-overload) constexpr expected(U&& v) : var_(std::in_place_index<0>, std::forward(v)) {} template , std::remove_cv_t>> && !std::is_convertible_v /* explicit */ )> + // NOLINTNEXTLINE(bugprone-forwarding-reference-overload) constexpr explicit expected(U&& v) : var_(std::in_place_index<0>, T(std::forward(v))) {} template && !std::is_same_v>, std::in_place_t> && !std::is_same_v>, unexpected>)> - // NOLINTNEXTLINE(google-explicit-constructor) + // NOLINTNEXTLINE(google-explicit-constructor,bugprone-forwarding-reference-overload) constexpr unexpected(Err&& e) : val_(std::forward(e)) {} template Error& operator<<(T&& t) { + // NOLINTNEXTLINE(bugprone-suspicious-semicolon) if constexpr (std::is_same_v>, ResultError>) { errno_ = t.code(); return (*this) << t.message();