music / rpms / highfive

Forked from rpms/highfive 2 years ago
Clone
Blob Blame History Raw
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