summaryrefslogtreecommitdiffstats
path: root/Source/cmCMakePresetsFile.h
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-10-14 16:13:23 (GMT)
committerSean McBride <sean@rogue-research.com>2021-10-15 15:23:12 (GMT)
commite2a4718d186d4848bae2beb926279ea334e0fef3 (patch)
treec5f6f7ed5526d131bc534cb6bd6a86c00361f917 /Source/cmCMakePresetsFile.h
parent315fc296e3c1ecddbf59a2144b0dff9a05c715ed (diff)
downloadCMake-e2a4718d186d4848bae2beb926279ea334e0fef3.zip
CMake-e2a4718d186d4848bae2beb926279ea334e0fef3.tar.gz
CMake-e2a4718d186d4848bae2beb926279ea334e0fef3.tar.bz2
Source: Fix Clang -Wdeprecated warnings
Applied C++ 'rule of three'.
Diffstat (limited to 'Source/cmCMakePresetsFile.h')
-rw-r--r--Source/cmCMakePresetsFile.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/cmCMakePresetsFile.h b/Source/cmCMakePresetsFile.h
index 7aa9b6a..c48a1f8 100644
--- a/Source/cmCMakePresetsFile.h
+++ b/Source/cmCMakePresetsFile.h
@@ -60,18 +60,20 @@ public:
class Preset
{
public:
-#if __cplusplus < 201703L && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)
+ Preset() = default;
+ Preset(Preset&& /*other*/) = default;
+ Preset(const Preset& /*other*/) = default;
+ Preset& operator=(const Preset& /*other*/) = default;
+ virtual ~Preset() = default;
+#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+ Preset& operator=(Preset&& /*other*/) = default;
+#else
// The move assignment operators for several STL classes did not become
// noexcept until C++17, which causes some tools to warn about this move
- // assignment operator throwing an exception when it shouldn't. Disable the
- // move assignment operator until C++17 is enabled.
- // Explicitly defining a copy assignment operator prevents the compiler
- // from automatically generating a move assignment operator.
- Preset& operator=(const Preset& /*other*/) = default;
+ // assignment operator throwing an exception when it shouldn't.
+ Preset& operator=(Preset&& /*other*/) = delete;
#endif
- virtual ~Preset() = default;
-
std::string Name;
std::vector<std::string> Inherits;
bool Hidden;