+2020-04-20 Tom Tromey <tromey@adacore.com>
+
+ * python/python.c (struct gdbpy_event): Mark move constructor as
+ noexcept.
+ * python/py-tui.c (class gdbpy_tui_window_maker): Mark move
+ constructor as noexcept.
+ * completer.h (struct completion_result): Mark move constructor as
+ noexcept.
+ * completer.c (completion_result::completion_result): Use
+ initialization style. Don't call reset_match_list.
+
2020-04-20 Mihails Strasuns <mihails.strasuns@intel.com>
* MAINTAINERS (Write After Approval): Add myself.
/* See completer.h */
-completion_result::completion_result (completion_result &&rhs)
+completion_result::completion_result (completion_result &&rhs) noexcept
+ : match_list (rhs.match_list),
+ number_matches (rhs.number_matches)
{
- if (this == &rhs)
- return;
-
- reset_match_list ();
- match_list = rhs.match_list;
rhs.match_list = NULL;
- number_matches = rhs.number_matches;
rhs.number_matches = 0;
}
DISABLE_COPY_AND_ASSIGN (completion_result);
/* Move a result. */
- completion_result (completion_result &&rhs);
+ completion_result (completion_result &&rhs) noexcept;
/* Release ownership of the match list array. */
char **release_match_list ();
~gdbpy_tui_window_maker ();
- gdbpy_tui_window_maker (gdbpy_tui_window_maker &&other)
+ gdbpy_tui_window_maker (gdbpy_tui_window_maker &&other) noexcept
: m_constr (std::move (other.m_constr))
{
}
{
}
- gdbpy_event (gdbpy_event &&other)
+ gdbpy_event (gdbpy_event &&other) noexcept
: m_func (other.m_func)
{
other.m_func = nullptr;
+2020-04-20 Tom Tromey <tromey@adacore.com>
+
+ * scoped_mmap.h (scoped_mmap): Mark move constructor as noexcept.
+ Use initialization style. Don't call destroy.
+ * scoped_fd.h (class scoped_fd): Mark move constructor as
+ noexcept.
+ * gdb_ref_ptr.h (class ref_ptr): Mark move constructor as
+ noexcept.
+
2020-04-13 Tom Tromey <tom@tromey.com>
* event-loop.c: Move comment. Remove obsolete comment.
}
/* Transfer ownership from OTHER. */
- ref_ptr (ref_ptr &&other)
+ ref_ptr (ref_ptr &&other) noexcept
: m_obj (other.m_obj)
{
other.m_obj = NULL;
public:
explicit scoped_fd (int fd = -1) noexcept : m_fd (fd) {}
- scoped_fd (scoped_fd &&other)
+ scoped_fd (scoped_fd &&other) noexcept
: m_fd (other.m_fd)
{
other.m_fd = -1;
destroy ();
}
- scoped_mmap (scoped_mmap &&rhs)
+ scoped_mmap (scoped_mmap &&rhs) noexcept
+ : m_mem (rhs.m_mem),
+ m_length (rhs.m_length)
{
- destroy ();
-
- m_mem = rhs.m_mem;
- m_length = rhs.m_length;
-
rhs.m_mem = MAP_FAILED;
rhs.m_length = 0;
}