I recently learned that move constructors generally should be marked "noexcept". This ensures that standard containers will move objects when possible, rather than copy them. This patch fixes the cases I could find. Note that implicitly-defined or defaulted move constructors will automatically do what you'd expect; that is, they are noexcept if all the members have noexcept move constructors. While doing this, I noticed a couple of odd cases where the move constructor seemed to assume that the object being constructed could have state requiring destruction. I've fixed these as well. See completion_result and scoped_mmap. gdb/ChangeLog 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. gdbsupport/ChangeLog 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. |
||
|---|---|---|
| .. | ||
| lib/gdb | ||
| py-all-events.def | ||
| py-arch.c | ||
| py-auto-load.c | ||
| py-block.c | ||
| py-bpevent.c | ||
| py-breakpoint.c | ||
| py-cmd.c | ||
| py-continueevent.c | ||
| py-event-types.def | ||
| py-event.c | ||
| py-event.h | ||
| py-events.h | ||
| py-evtregistry.c | ||
| py-evts.c | ||
| py-exitedevent.c | ||
| py-finishbreakpoint.c | ||
| py-frame.c | ||
| py-framefilter.c | ||
| py-function.c | ||
| py-gdb-readline.c | ||
| py-inferior.c | ||
| py-infevents.c | ||
| py-infthread.c | ||
| py-instruction.c | ||
| py-instruction.h | ||
| py-lazy-string.c | ||
| py-linetable.c | ||
| py-newobjfileevent.c | ||
| py-objfile.c | ||
| py-param.c | ||
| py-prettyprint.c | ||
| py-progspace.c | ||
| py-record-btrace.c | ||
| py-record-btrace.h | ||
| py-record-full.c | ||
| py-record-full.h | ||
| py-record.c | ||
| py-record.h | ||
| py-ref.h | ||
| py-signalevent.c | ||
| py-stopevent.c | ||
| py-stopevent.h | ||
| py-symbol.c | ||
| py-symtab.c | ||
| py-threadevent.c | ||
| py-tui.c | ||
| py-type.c | ||
| py-unwind.c | ||
| py-utils.c | ||
| py-value.c | ||
| py-varobj.c | ||
| py-xmethods.c | ||
| python-config.py | ||
| python-internal.h | ||
| python.c | ||
| python.h | ||