Compare commits

..

4 Commits

Author SHA1 Message Date
Peter Dimov
acaca854c4 More Clang warning suppression 2021-12-16 06:20:42 +02:00
Peter Dimov
277757befc Disable -Wmaybe-uninitialized in function_template.hpp for GCC 11 2021-12-16 06:18:06 +02:00
Peter Dimov
61479788b8 Additional Clang warning fixes 2021-12-16 05:25:03 +02:00
Peter Dimov
e47b6a51e4 Test with warnings=extra, warnings-as-errors=on 2021-12-16 04:59:39 +02:00
8 changed files with 43 additions and 4 deletions

View File

@@ -1010,8 +1010,16 @@ namespace boost {
# pragma GCC diagnostic pop # pragma GCC diagnostic pop
# endif # endif
} else } else
#if defined(BOOST_GCC) && (__GNUC__ == 11)
# pragma GCC diagnostic push
// False positive in GCC 11 for empty function objects (function_n_test.cpp:673)
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
get_vtable()->base.manager(f.functor, this->functor, get_vtable()->base.manager(f.functor, this->functor,
boost::detail::function::move_functor_tag); boost::detail::function::move_functor_tag);
#if defined(BOOST_GCC) && (__GNUC__ == 11)
# pragma GCC diagnostic pop
#endif
f.vtable = 0; f.vtable = 0;
} else { } else {
clear(); clear();

View File

@@ -9,6 +9,15 @@
import testing ; import testing ;
project
: default-build
<warnings>extra
: requirements
<toolset>msvc:<warnings-as-errors>on
<toolset>gcc:<warnings-as-errors>on
<toolset>clang:<warnings-as-errors>on
;
run function_test.cpp ; run function_test.cpp ;
# /usr/include/c++/4.4/bits/shared_ptr.h:146: error: cannot use typeid with -fno-rtti # /usr/include/c++/4.4/bits/shared_ptr.h:146: error: cannot use typeid with -fno-rtti
run function_test.cpp : : : <rtti>off <toolset>gcc-4.4.7,<cxxstd>0x:<build>no : function_test_no_rtti ; run function_test.cpp : : : <rtti>off <toolset>gcc-4.4.7,<cxxstd>0x:<build>no : function_test_no_rtti ;

View File

@@ -7,6 +7,12 @@
// For more information, see http://www.boost.org // For more information, see http://www.boost.org
#if defined(__clang__) && defined(__has_warning)
# if __has_warning( "-Wself-assign-overloaded" )
# pragma clang diagnostic ignored "-Wself-assign-overloaded"
# endif
#endif
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/core/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <functional> #include <functional>

View File

@@ -7,6 +7,12 @@
// For more information, see http://www.boost.org // For more information, see http://www.boost.org
#if defined(__clang__) && defined(__has_warning)
# if __has_warning( "-Wself-assign-overloaded" )
# pragma clang diagnostic ignored "-Wself-assign-overloaded"
# endif
#endif
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/core/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <functional> #include <functional>

View File

@@ -16,7 +16,7 @@
struct Y { struct Y {
Y(int y = 0) : y_(y) {} Y(int y = 0) : y_(y) {}
bool operator==(const Y& rhs) { return y_ == rhs.y_; } bool operator==(const Y& rhs) const { return y_ == rhs.y_; }
private: private:
int y_; int y_;
}; };

View File

@@ -16,7 +16,7 @@
struct Y { struct Y {
Y(int y = 0) : y_(y) {} Y(int y = 0) : y_(y) {}
bool operator==(const Y& rhs) { return y_ == rhs.y_; } bool operator==(const Y& rhs) const { return y_ == rhs.y_; }
private: private:
int y_; int y_;
}; };

View File

@@ -8,6 +8,11 @@
// For more information, see http://www.boost.org/ // For more information, see http://www.boost.org/
#if defined(__clang__) && defined(__has_warning)
# if __has_warning( "-Wdeprecated-declarations" )
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
# endif
#endif
#include <boost/function.hpp> #include <boost/function.hpp>
#include <iostream> #include <iostream>

View File

@@ -8,6 +8,11 @@
// For more information, see http://www.boost.org/ // For more information, see http://www.boost.org/
#if defined(__clang__) && defined(__has_warning)
# if __has_warning( "-Wdeprecated-declarations" )
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
# endif
#endif
#include <boost/function.hpp> #include <boost/function.hpp>
#include <iostream> #include <iostream>