highfive/0001-Use-std-move-in-NRVO-depending-of-version-of-GCC-375.patch
Ankur Sinha (Ankur Sinha Gmail) 381af8bf40
feat: init
2021-04-19 11:28:31 +01:00

31 lines
1009 B
Diff

From 7434d54b84ce54fae950d505de4ff0d772f63e94 Mon Sep 17 00:00:00 2001
From: Nicolas Cornu <nicolas.cornu@epfl.ch>
Date: Fri, 25 Sep 2020 17:14:11 +0200
Subject: [PATCH] Use std::move in NRVO depending of version of GCC (#375)
Before version 10, GCC warns if not used.
After version 10, GCC warns if used.
---
include/highfive/bits/H5Reference_misc.hpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/highfive/bits/H5Reference_misc.hpp b/include/highfive/bits/H5Reference_misc.hpp
index 7c892c1..b4aea3e 100644
--- a/include/highfive/bits/H5Reference_misc.hpp
+++ b/include/highfive/bits/H5Reference_misc.hpp
@@ -43,7 +43,11 @@ inline T Reference::dereference(const Object& location) const {
HDF5ErrMapper::ToException<ReferenceException>(
"Trying to dereference the wrong type");
}
+#if defined __GNUC__ && __GNUC__ < 9
return std::move(obj);
+#else
+ return obj;
+#endif
}
inline Object Reference::get_ref(const Object& location) const {
--
2.31.1