From 71bd96ad7184df83c7af04ffa8e0d6678ab26f99 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Wed, 20 May 2020 16:52:51 +0200 Subject: [PATCH] Disallow copying and moving TagNode Change-Id: I1a350edaff300c68a4a7314ea984382b88288413 Signed-off-by: Bartosz Dunajski --- opencl/test/unit_test/utilities/tag_allocator_tests.cpp | 5 +++++ shared/source/utilities/tag_allocator.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/opencl/test/unit_test/utilities/tag_allocator_tests.cpp b/opencl/test/unit_test/utilities/tag_allocator_tests.cpp index 45c2fae936..c8efc8261b 100644 --- a/opencl/test/unit_test/utilities/tag_allocator_tests.cpp +++ b/opencl/test/unit_test/utilities/tag_allocator_tests.cpp @@ -79,6 +79,11 @@ class MockTagAllocator : public TagAllocator { } }; +TEST_F(TagAllocatorTest, givenTagNodeTypeWhenCopyingOrMovingThenDisallow) { + EXPECT_FALSE(std::is_move_constructible>::value); + EXPECT_FALSE(std::is_copy_constructible>::value); +} + TEST_F(TagAllocatorTest, Initialize) { MockTagAllocator tagAllocator(memoryManager, 100, 64, deviceBitfield); diff --git a/shared/source/utilities/tag_allocator.h b/shared/source/utilities/tag_allocator.h index 083dc81c48..d4621754ed 100644 --- a/shared/source/utilities/tag_allocator.h +++ b/shared/source/utilities/tag_allocator.h @@ -23,7 +23,7 @@ template class TagAllocator; template -struct TagNode : public IDNode> { +struct TagNode : public IDNode>, NonCopyableOrMovableClass { public: TagType *tagForCpuAccess;