Fix inconsistent noexcept-ness between header/implementation

Even though we disable exceptions, we use noexcept in some
places to enable certain optimizations in std::vector, see
https://en.cppreference.com/w/cpp/utility/move_if_noexcept.

Some methods have noexcept only at their declaration (or only at the
definition).  This will be an error when compiling with "g++ -std=c++17". Make
both signatures match.
This commit is contained in:
Johannes Altmanninger 2022-04-16 21:17:12 +02:00
parent 8c7ba5efea
commit ccb6cb1abe
2 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ class autoload_t {
/// Construct an autoloader that loads from the paths given by \p env_var_name. /// Construct an autoloader that loads from the paths given by \p env_var_name.
explicit autoload_t(wcstring env_var_name); explicit autoload_t(wcstring env_var_name);
autoload_t(autoload_t &&); autoload_t(autoload_t &&) noexcept;
~autoload_t(); ~autoload_t();
/// Given a command, get a path to autoload. /// Given a command, get a path to autoload.

View File

@ -226,9 +226,9 @@ completion_t::completion_t(wcstring comp, wcstring desc, string_fuzzy_match_t ma
flags(resolve_auto_space(completion, flags_val)) {} flags(resolve_auto_space(completion, flags_val)) {}
completion_t::completion_t(const completion_t &) = default; completion_t::completion_t(const completion_t &) = default;
completion_t::completion_t(completion_t &&) = default; completion_t::completion_t(completion_t &&) noexcept = default;
completion_t &completion_t::operator=(const completion_t &) = default; completion_t &completion_t::operator=(const completion_t &) = default;
completion_t &completion_t::operator=(completion_t &&) = default; completion_t &completion_t::operator=(completion_t &&) noexcept = default;
completion_t::~completion_t() = default; completion_t::~completion_t() = default;
__attribute__((always_inline)) static inline bool natural_compare_completions( __attribute__((always_inline)) static inline bool natural_compare_completions(