diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2009-05-27 20:32:30 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2009-05-27 20:32:30 +0000 |
commit | 626e0599af96df36ac6b847349a33948d7bb3f7e (patch) | |
tree | d99980c516af84be2d033dd11a9de54c70f5c509 /libstdc++-v3/include/tr1_impl/functional | |
parent | 667e6f892412bcd32deb79ebfb8d41e211e9cbed (diff) | |
download | gcc-626e0599af96df36ac6b847349a33948d7bb3f7e.tar.gz |
re PR libstdc++/40273 ([C++0x] Invalid conversion to bool is reported)
2009-05-27 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/40273
* include/tr1_impl/functional: Add explicit cast.
* testsuite/20_util/function/requirements/
explicit_instantiation.cc: New.
* testsuite/20_util/function/null_pointer_comparisons.cc: New.
From-SVN: r147930
Diffstat (limited to 'libstdc++-v3/include/tr1_impl/functional')
-rw-r--r-- | libstdc++-v3/include/tr1_impl/functional | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libstdc++-v3/include/tr1_impl/functional b/libstdc++-v3/include/tr1_impl/functional index 980061d6902..584a403de48 100644 --- a/libstdc++-v3/include/tr1_impl/functional +++ b/libstdc++-v3/include/tr1_impl/functional @@ -1557,7 +1557,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 template<typename _Signature> static bool _M_not_empty_function(const function<_Signature>& __f) - { return __f; } + { return static_cast<bool>(__f); } template<typename _Tp> static bool @@ -2095,13 +2095,13 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 template<typename _Signature> inline bool operator==(const function<_Signature>& __f, _M_clear_type*) - { return !__f; } + { return !static_cast<bool>(__f); } /// @overload template<typename _Signature> inline bool operator==(_M_clear_type*, const function<_Signature>& __f) - { return !__f; } + { return !static_cast<bool>(__f); } /** * @brief Compares a polymorphic function object wrapper against 0 @@ -2113,13 +2113,13 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 template<typename _Signature> inline bool operator!=(const function<_Signature>& __f, _M_clear_type*) - { return __f; } + { return static_cast<bool>(__f); } /// @overload template<typename _Signature> inline bool operator!=(_M_clear_type*, const function<_Signature>& __f) - { return __f; } + { return static_cast<bool>(__f); } // [3.7.2.8] specialized algorithms |