Skip to content

Commit

Permalink
Suppress Intel Compiler deprecation warning for STL in test_allocator…
Browse files Browse the repository at this point in the history
…s.cpp (#1626)
  • Loading branch information
kboyarinov authored Feb 5, 2025
1 parent 1684f05 commit fa5ed8e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/tbb/test_allocators.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -14,6 +14,17 @@
limitations under the License.
*/

#include <tbb/version.h> // 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"

Expand Down Expand Up @@ -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

0 comments on commit fa5ed8e

Please sign in to comment.