From fa5ed8e81c1ca088b7627e031b9cb059504edb16 Mon Sep 17 00:00:00 2001 From: Konstantin Boyarinov Date: Wed, 5 Feb 2025 16:01:25 +0200 Subject: [PATCH] Suppress Intel Compiler deprecation warning for STL in test_allocators.cpp (#1626) --- test/tbb/test_allocators.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/tbb/test_allocators.cpp b/test/tbb/test_allocators.cpp index 78fd0cf565..a31778db3c 100644 --- a/test/tbb/test_allocators.cpp +++ b/test/tbb/test_allocators.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2022 Intel Corporation + Copyright (c) 2005-2025 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,17 @@ limitations under the License. */ +#include // For __TBB_GLIBCXX_VERSION and __TBB_CPP20_PRESENT + +// Intel LLVM compiler triggers a deprecation warning in the implementation of std::allocator_traits::destroy +// inside Standard Library while using STL PMR containers since std::polymorphic_allocator::destroy is deprecated since C++20 +#define TEST_LLVM_COMPILER_PMR_DESTROY_DEPRECATED_BROKEN __INTEL_LLVM_COMPILER == 20250000 && __TBB_GLIBCXX_VERSION == 110000 && __TBB_CPP20_PRESENT + +#if TEST_LLVM_COMPILER_PMR_DESTROY_DEPRECATED_BROKEN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + #include "tbb/cache_aligned_allocator.h" #include "tbb/tbb_allocator.h" @@ -100,3 +111,6 @@ TEST_CASE("polymorphic_allocator test") { } #endif +#if TEST_LLVM_COMPILER_PMR_DESTROY_DEPRECATED_BROKEN +#pragma clang diagnostic pop // "-Wdeprecated-declarations" +#endif