From 35d79a36c908cd14ac51885140453b9c2aa581d5 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 20 Oct 2017 02:47:23 +0100 Subject: [PATCH] Suppress warnings about std::auto_ptr in factory tests They're testing that the library works with std::auto_ptr, the library itself doesn't use it. --- factory/test/factory.cpp | 15 ++++++++++++--- factory/test/factory_with_none_t.cpp | 10 ++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/factory/test/factory.cpp b/factory/test/factory.cpp index 76afe7b..6894481 100644 --- a/factory/test/factory.cpp +++ b/factory/test/factory.cpp @@ -1,7 +1,7 @@ /*============================================================================= Copyright (c) 2007 Tobias Schwinger - - Use modification and distribution are subject to the Boost Software + + Use modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). ==============================================================================*/ @@ -11,7 +11,7 @@ #include -class sum +class sum { int val_sum; public: @@ -20,6 +20,12 @@ class sum operator int() const { return this->val_sum; } }; +// Suppress warnings about std::auto_ptr. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + int main() { int one = 1, two = 2; @@ -42,3 +48,6 @@ int main() return boost::report_errors(); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif diff --git a/factory/test/factory_with_none_t.cpp b/factory/test/factory_with_none_t.cpp index 168dc26..bdca2c2 100644 --- a/factory/test/factory_with_none_t.cpp +++ b/factory/test/factory_with_none_t.cpp @@ -21,6 +21,12 @@ class sum operator int() const { return this->val_sum; } }; +// Suppress warnings about std::auto_ptr. +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + int main() { int one = 1, two = 2; @@ -44,3 +50,7 @@ int main() #endif return boost::report_errors(); } + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif