Return v_.index() == 1 from has_error() to avoid -Wmaybe-uninitialized in error()

This commit is contained in:
Peter Dimov
2022-08-02 22:44:34 +03:00
parent f2e1db8021
commit cc7c2f7ee4

View File

@ -222,7 +222,7 @@ public:
constexpr bool has_error() const noexcept
{
return v_.index() != 0;
return v_.index() == 1;
}
constexpr explicit operator bool() const noexcept
@ -511,7 +511,7 @@ public:
constexpr bool has_error() const noexcept
{
return v_.index() != 0;
return v_.index() == 1;
}
constexpr explicit operator bool() const noexcept