diff --git a/test/function_n_test.cpp b/test/function_n_test.cpp index 48fefc3..7fcf3f2 100644 --- a/test/function_n_test.cpp +++ b/test/function_n_test.cpp @@ -7,8 +7,10 @@ // For more information, see http://www.boost.org -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wself-assign-overloaded" +#if defined(__clang__) && defined(__has_warning) +# if __has_warning( "-Wself-assign-overloaded" ) +# pragma clang diagnostic ignored "-Wself-assign-overloaded" +# endif #endif #include diff --git a/test/function_test.cpp b/test/function_test.cpp index f6b7301..7592837 100644 --- a/test/function_test.cpp +++ b/test/function_test.cpp @@ -7,8 +7,10 @@ // For more information, see http://www.boost.org -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wself-assign-overloaded" +#if defined(__clang__) && defined(__has_warning) +# if __has_warning( "-Wself-assign-overloaded" ) +# pragma clang diagnostic ignored "-Wself-assign-overloaded" +# endif #endif #include diff --git a/test/mem_fun_cxx98.cpp b/test/mem_fun_cxx98.cpp index 9274036..b42cc00 100644 --- a/test/mem_fun_cxx98.cpp +++ b/test/mem_fun_cxx98.cpp @@ -16,7 +16,7 @@ struct 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: int y_; }; diff --git a/test/mem_fun_portable.cpp b/test/mem_fun_portable.cpp index e12fd08..0cf1ed4 100644 --- a/test/mem_fun_portable.cpp +++ b/test/mem_fun_portable.cpp @@ -16,7 +16,7 @@ struct 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: int y_; };