diff --git a/src/json.hpp b/src/json.hpp
index 35bdd293..d9c75c4a 100644
--- a/src/json.hpp
+++ b/src/json.hpp
@@ -8480,7 +8480,7 @@ basic_json_parser_63:
 
             // return parser result and replace it with null in case the
             // top-level value was discarded by the callback function
-            return result.is_discarded() ? basic_json() : result;
+            return result.is_discarded() ? basic_json() : std::move(result);
         }
 
       private:
diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c
index 016ff0c5..ba045342 100644
--- a/src/json.hpp.re2c
+++ b/src/json.hpp.re2c
@@ -7790,7 +7790,7 @@ class basic_json
 
             // return parser result and replace it with null in case the
             // top-level value was discarded by the callback function
-            return result.is_discarded() ? basic_json() : result;
+            return result.is_discarded() ? basic_json() : std::move(result);
         }
 
       private: