summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2023-01-01 13:02:14 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-01-01 13:02:29 (GMT)
commited9cdcd73ae54fdf9d0eb9a963be3df29ac06240 (patch)
treecf5b3e8c3cc057ba18450fca68beff43b366dbbf
parent3f7322595ccad5f485a0f77f2aea5072620db379 (diff)
parentba981bb2ed170a6e59614657b04b204f7db4893d (diff)
downloadCMake-ed9cdcd73ae54fdf9d0eb9a963be3df29ac06240.zip
CMake-ed9cdcd73ae54fdf9d0eb9a963be3df29ac06240.tar.gz
CMake-ed9cdcd73ae54fdf9d0eb9a963be3df29ac06240.tar.bz2
Merge topic 'std-move-on-return-warning'
ba981bb2ed TryCompileCode(): Prevent warning on return value Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8043
-rw-r--r--Source/cmCoreTryCompile.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 25a0e2d..2a4ea80 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -7,6 +7,7 @@
#include <cstring>
#include <set>
#include <sstream>
+#include <type_traits>
#include <utility>
#include <cm/string_view>
@@ -1131,7 +1132,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
result.VariableCached = !arguments.NoCache;
result.Output = std::move(output);
result.ExitCode = res;
- return result;
+ return cm::optional<cmTryCompileResult>(std::move(result));
}
bool cmCoreTryCompile::IsTemporary(std::string const& path)