]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Add noexcept to Args move constructor/operator=
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 27 Apr 2020 14:39:02 +0000 (16:39 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 27 Apr 2020 14:39:02 +0000 (16:39 +0200)
As suggested by clang-tidy.

src/Args.cpp
src/Args.hpp

index d1240995ee19cdbf48bb5f477a37c557c2ca4dc4..39cba545d42d7a09d4bc5b453f6edd6715b592b6 100644 (file)
@@ -28,7 +28,8 @@ Args::Args(const Args& other) : m_args(other.m_args), argv(m_args)
 {
 }
 
-Args::Args(Args&& other) : m_args(std::move(other.m_args)), argv(m_args)
+Args::Args(Args&& other) noexcept
+  : m_args(std::move(other.m_args)), argv(m_args)
 {
 }
 
@@ -134,7 +135,7 @@ Args::operator=(const Args& other)
 }
 
 Args&
-Args::operator=(Args&& other)
+Args::operator=(Args&& other) noexcept
 {
   m_args = std::move(other.m_args);
   argv.m_args = &m_args;
index 7642a289d2ff4e076aae87feafffdc4495c14561..ab1a91f384d6710154a1803a28e8687d135255fe 100644 (file)
@@ -34,14 +34,14 @@ class Args
 public:
   Args();
   Args(const Args& other);
-  Args(Args&& other);
+  Args(Args&& other) noexcept;
 
   static Args from_argv(int argc, const char* const* argv);
   static Args from_string(const std::string& command);
   static nonstd::optional<Args> from_gcc_atfile(const std::string& filename);
 
   Args& operator=(const Args& other);
-  Args& operator=(Args&& other);
+  Args& operator=(Args&& other) noexcept;
 
   bool operator==(const Args& other) const;
   bool operator!=(const Args& other) const;