Skip to content

Commit fa5ed8e

Browse files
authored
Suppress Intel Compiler deprecation warning for STL in test_allocators.cpp (#1626)
1 parent 1684f05 commit fa5ed8e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/tbb/test_allocators.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005-2022 Intel Corporation
2+
Copyright (c) 2005-2025 Intel Corporation
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -14,6 +14,17 @@
1414
limitations under the License.
1515
*/
1616

17+
#include <tbb/version.h> // For __TBB_GLIBCXX_VERSION and __TBB_CPP20_PRESENT
18+
19+
// Intel LLVM compiler triggers a deprecation warning in the implementation of std::allocator_traits::destroy
20+
// inside Standard Library while using STL PMR containers since std::polymorphic_allocator::destroy is deprecated since C++20
21+
#define TEST_LLVM_COMPILER_PMR_DESTROY_DEPRECATED_BROKEN __INTEL_LLVM_COMPILER == 20250000 && __TBB_GLIBCXX_VERSION == 110000 && __TBB_CPP20_PRESENT
22+
23+
#if TEST_LLVM_COMPILER_PMR_DESTROY_DEPRECATED_BROKEN
24+
#pragma clang diagnostic push
25+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
26+
#endif
27+
1728
#include "tbb/cache_aligned_allocator.h"
1829
#include "tbb/tbb_allocator.h"
1930

@@ -100,3 +111,6 @@ TEST_CASE("polymorphic_allocator test") {
100111
}
101112
#endif
102113

114+
#if TEST_LLVM_COMPILER_PMR_DESTROY_DEPRECATED_BROKEN
115+
#pragma clang diagnostic pop // "-Wdeprecated-declarations"
116+
#endif

0 commit comments

Comments
 (0)