summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-02-21 12:38:25 +0100
committerAlberto Sartori <alberto.sartori@huawei.com>2023-03-31 16:14:38 +0200
commit84fdf3b7da3472790ff894220b445035d30d8e70 (patch)
tree6f7a9712a03ac52b4131a54639594111a4a825e2 /test
parent993b322d40f6ed347efb0f24ccaca4be1d70cca4 (diff)
downloadjustbuild-84fdf3b7da3472790ff894220b445035d30d8e70.tar.gz
fix false positive warning with gcc12
Diffstat (limited to 'test')
-rw-r--r--test/buildtool/execution_engine/executor/executor.test.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp
index 8e187115..6793014b 100644
--- a/test/buildtool/execution_engine/executor/executor.test.cpp
+++ b/test/buildtool/execution_engine/executor/executor.test.cpp
@@ -143,10 +143,15 @@ class TestApi : public IExecutionApi {
bool /*unused*/) noexcept -> bool final {
return false; // not needed by Executor
}
- auto RetrieveToCas(std::vector<Artifact::ObjectInfo> const& /*unused*/,
+ auto RetrieveToCas(std::vector<Artifact::ObjectInfo> const& unused,
gsl::not_null<IExecutionApi*> const& /*unused*/) noexcept
-> bool final {
- return false; // not needed by Executor
+ // Note that a false-positive "free-nonheap-object" warning is thrown by
+ // gcc 12.2 with GNU libstdc++, if the caller passes a temporary vector
+ // that is not used by this function. Therefore, we explicitly use this
+ // vector here to suppress this warning. The actual value returned is
+ // irrelevant for testing though.
+ return unused.empty(); // not needed by Executor
}
auto Upload(BlobContainer const& blobs, bool /*unused*/) noexcept
-> bool final {