diff --git a/gdb/inferior.h b/gdb/inferior.h index 6662a3bde46..94fbac0fc57 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -676,7 +676,7 @@ extern intrusive_list inferior_list; inline all_inferiors_safe_range all_inferiors_safe () { - return {}; + return all_inferiors_safe_range (nullptr, inferior_list); } /* Returns a range representing all inferiors, suitable to use with diff --git a/gdbsupport/safe-iterator.h b/gdbsupport/safe-iterator.h index 5cfc5b6ee69..53868d3b3ee 100644 --- a/gdbsupport/safe-iterator.h +++ b/gdbsupport/safe-iterator.h @@ -48,11 +48,11 @@ public: typedef typename Iterator::iterator_category iterator_category; typedef typename Iterator::difference_type difference_type; - /* Construct using the given argument; the end iterator is default - constructed. */ - template - explicit basic_safe_iterator (Arg &&arg) - : m_it (std::forward (arg)), + /* Construct the begin iterator using the given arguments; the end iterator is + default constructed. */ + template + explicit basic_safe_iterator (Args &&...args) + : m_it (std::forward (args)...), m_next (m_it) { if (m_it != m_end)