summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileCache.h
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-05-17 18:22:01 (GMT)
committerBrad King <brad.king@kitware.com>2022-05-24 13:09:44 (GMT)
commitc8c9d7de0395fa7384ae823d5ee3bebdb310a172 (patch)
treeb5431c25e659da2b8bd428ec96def63f262e6dbc /Source/cmListFileCache.h
parentaa3649eb0488fe9ea82c330f2c0c606bbb9d32f4 (diff)
downloadCMake-c8c9d7de0395fa7384ae823d5ee3bebdb310a172.zip
CMake-c8c9d7de0395fa7384ae823d5ee3bebdb310a172.tar.gz
CMake-c8c9d7de0395fa7384ae823d5ee3bebdb310a172.tar.bz2
clang-tidy: fix `bugprone-exception-escape` lints
Diffstat (limited to 'Source/cmListFileCache.h')
-rw-r--r--Source/cmListFileCache.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index f7c2509..0553989 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -110,16 +110,22 @@ public:
cm::optional<std::string> DeferId;
cmListFileContext() = default;
- cmListFileContext(cmListFileContext&& /*other*/) = default;
+ // This move constructor is marked `noexcept` yet `clang-tidy` 14 reports it
+ // as being able to throw an exception. Suppress the warning as there doesn't
+ // seem to be any way for this to happen given the member types.
+ // NOLINTNEXTLINE(bugprone-exception-escape)
+ cmListFileContext(cmListFileContext&& /*other*/) noexcept = default;
cmListFileContext(const cmListFileContext& /*other*/) = default;
cmListFileContext& operator=(const cmListFileContext& /*other*/) = default;
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
- cmListFileContext& operator=(cmListFileContext&& /*other*/) = default;
+ cmListFileContext& operator=(cmListFileContext&& /*other*/) noexcept =
+ 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.
- cmListFileContext& operator=(cmListFileContext&& /*other*/) = delete;
+ cmListFileContext& operator=(cmListFileContext&& /*other*/) noexcept =
+ delete;
#endif
cmListFileContext(std::string name, std::string filePath, long line)