Message ID | 20240202103952.2243921-1-jwakely@redhat.com |
---|---|
State | New |
Headers | show |
Series | [committed,gcc-12] libstdc++: Force-inline shared_ptr::operator bool() for C++20 [PR108636] | expand |
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index c22b397a194..23c3b17d46f 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -1666,6 +1666,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return _M_ptr; } /// Return true if the stored pointer is not null. +#if __cplusplus >= 202002L + [[__gnu__::__always_inline__]] +#endif explicit operator bool() const noexcept { return _M_ptr != nullptr; }