From 51c9ad1359183f455b6b948700470c20da6fb7fd Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 18 Feb 2018 18:44:58 -0800 Subject: [PATCH] Mark trivial constructors/destructors as default --- muparser-2.2.5/src/muParserError.cpp | 2 +- src/builtin_string.cpp | 10 +++++----- src/builtin_test.cpp | 4 ++-- src/env_universal_common.cpp | 4 ++-- src/event.cpp | 2 +- src/io.cpp | 2 +- src/maybe.h | 2 +- src/parser.cpp | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/muparser-2.2.5/src/muParserError.cpp b/muparser-2.2.5/src/muParserError.cpp index 6e4a88917..a2e05ecc6 100644 --- a/muparser-2.2.5/src/muParserError.cpp +++ b/muparser-2.2.5/src/muParserError.cpp @@ -185,7 +185,7 @@ ParserError::ParserError(const char_type *szMsg, int iPos, string_type sTok) } //------------------------------------------------------------------------------ -ParserError::~ParserError() {} +ParserError::~ParserError() = default; //------------------------------------------------------------------------------ /** \brief Replace all occurrences of a substring with another string. diff --git a/src/builtin_string.cpp b/src/builtin_string.cpp index 1813a3302..90d4e9fde 100644 --- a/src/builtin_string.cpp +++ b/src/builtin_string.cpp @@ -685,7 +685,7 @@ class string_matcher_t { string_matcher_t(options_t opts_, io_streams_t &streams_) : opts(std::move(opts_)), streams(streams_), total_matched(0) {} - virtual ~string_matcher_t() {} + virtual ~string_matcher_t() = default; virtual bool report_matches(const wchar_t *arg) = 0; int match_count() { return total_matched; } }; @@ -709,7 +709,7 @@ class wildcard_matcher_t : public string_matcher_t { } } - virtual ~wildcard_matcher_t() {} + virtual ~wildcard_matcher_t() = default; bool report_matches(const wchar_t *arg) { // Note: --all is a no-op for glob matching since the pattern is always matched @@ -849,7 +849,7 @@ class pcre2_matcher_t : public string_matcher_t { argv0(argv0_), regex(argv0_, pattern, opts.ignore_case, streams) {} - virtual ~pcre2_matcher_t() {} + virtual ~pcre2_matcher_t() = default; bool report_matches(const wchar_t *arg) { // A return value of true means all is well (even if no matches were found), false indicates @@ -959,7 +959,7 @@ class string_replacer_t { string_replacer_t(const wchar_t *argv0_, options_t opts_, io_streams_t &streams_) : argv0(argv0_), opts(std::move(opts_)), total_replaced(0), streams(streams_) {} - virtual ~string_replacer_t() {} + virtual ~string_replacer_t() = default; int replace_count() { return total_replaced; } virtual bool replace_matches(const wchar_t *arg) = 0; }; @@ -977,7 +977,7 @@ class literal_replacer_t : public string_replacer_t { replacement(replacement_), patlen(wcslen(pattern)) {} - virtual ~literal_replacer_t() {} + virtual ~literal_replacer_t() = default; bool replace_matches(const wchar_t *arg); }; diff --git a/src/builtin_test.cpp b/src/builtin_test.cpp index 086017971..786f3e5b5 100644 --- a/src/builtin_test.cpp +++ b/src/builtin_test.cpp @@ -190,7 +190,7 @@ class expression { const token_t token; range_t range; - virtual ~expression() {} + virtual ~expression() = default; /// Evaluate returns true if the expression is true (i.e. STATUS_CMD_OK). virtual bool evaluate(wcstring_list_t &errors) = 0; @@ -239,7 +239,7 @@ class combining_expression : public expression { assert(subjects.size() == combiners.size() + 1); } - virtual ~combining_expression() {} + virtual ~combining_expression() = default; bool evaluate(wcstring_list_t &errors); }; diff --git a/src/env_universal_common.cpp b/src/env_universal_common.cpp index ef279d507..13b593c88 100644 --- a/src/env_universal_common.cpp +++ b/src/env_universal_common.cpp @@ -1367,9 +1367,9 @@ std::unique_ptr universal_notifier_t::new_notifier_for_str } // Default implementations. -universal_notifier_t::universal_notifier_t() {} +universal_notifier_t::universal_notifier_t() = default; -universal_notifier_t::~universal_notifier_t() {} +universal_notifier_t::~universal_notifier_t() = default; int universal_notifier_t::notification_fd() { return -1; } diff --git a/src/event.cpp b/src/event.cpp index 12e8c8d54..1afbfe2e7 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -459,7 +459,7 @@ void event_fire_generic(const wchar_t *name, wcstring_list_t *args) { event_t::event_t(int t) : type(t), param1(), str_param1(), function_name(), arguments() {} -event_t::~event_t() {} +event_t::~event_t() = default; event_t event_t::signal_event(int sig) { event_t event(EVENT_SIGNAL); diff --git a/src/io.cpp b/src/io.cpp index b36a8d500..995877a19 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -13,7 +13,7 @@ #include "io.h" #include "wutil.h" // IWYU pragma: keep -io_data_t::~io_data_t() {} +io_data_t::~io_data_t() = default; void io_close_t::print() const { fwprintf(stderr, L"close %d\n", fd); } diff --git a/src/maybe.h b/src/maybe.h index ac493f350..e4c1fc20c 100644 --- a/src/maybe.h +++ b/src/maybe.h @@ -28,7 +28,7 @@ class maybe_t { explicit operator bool() const { return filled; } // The default constructor constructs a maybe with no value. - maybe_t() {} + maybe_t() = default; // Construct a maybe_t from a none_t /* implicit */ maybe_t(none_t n) { (void)n; } diff --git a/src/parser.cpp b/src/parser.cpp index 6658c281e..5b41eccac 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -103,7 +103,7 @@ static wcstring user_presentable_path(const wcstring &path) { parser_t::parser_t() : cancellation_requested(false), is_within_fish_initialization(false) {} // Out of line destructor to enable forward declaration of parse_execution_context_t -parser_t::~parser_t() {} +parser_t::~parser_t() = default; static parser_t s_principal_parser; @@ -788,7 +788,7 @@ void parser_t::get_backtrace(const wcstring &src, const parse_error_list_t &erro block_t::block_t(block_type_t t) : block_type(t) {} -block_t::~block_t() {} +block_t::~block_t() = default; wcstring block_t::description() const { wcstring result;