Additional Clang warning fixes

This commit is contained in:
Peter Dimov
2021-12-16 05:25:03 +02:00
parent e47b6a51e4
commit 61479788b8
4 changed files with 10 additions and 6 deletions

View File

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

View File

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

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_;
}; };