diff --git a/.clang-tidy b/.clang-tidy index f0cc73c23a..ab41236f36 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1 +1 @@ -Checks: 'misc-*, -misc-definitions-in-headers, -misc-non-private-member-variables-in-classes, -misc-no-recursion, -misc-include-cleaner, -misc-use-anonymous-namespace' +Checks: 'modernize-*, misc-*, -misc-definitions-in-headers, -misc-non-private-member-variables-in-classes, -misc-no-recursion, -misc-include-cleaner, -misc-use-anonymous-namespace, -modernize-use-trailing-return-type, -modernize-use-nodiscard, -modernize-use-emplace, -modernize-loop-convert, -modernize-pass-by-value, -modernize-use-equals-delete, -modernize-use-equals-default, -modernize-use-override, -modernize-avoid-c-arrays, -modernize-raw-string-literal, -modernize-concat-nested-namespaces' diff --git a/source/cppfront.cpp b/source/cppfront.cpp index a5dbb00ca5..a74264a0af 100644 --- a/source/cppfront.cpp +++ b/source/cppfront.cpp @@ -137,7 +137,7 @@ auto main( auto total_time = print_with_thousands(t.elapsed().count()); std::cout << "\n Time " << total_time << " ms"; - std::multimap< long long, std::string_view, std::greater > sorted_timers; + std::multimap< long long, std::string_view, std::greater<> > sorted_timers; for (auto [name, t] : timers) { sorted_timers.insert({t.elapsed().count(), name}); } diff --git a/source/io.h b/source/io.h index d7b71e1879..c320ff3373 100644 --- a/source/io.h +++ b/source/io.h @@ -841,7 +841,7 @@ class source static const int max_line_len = 90'000; // do not reduce this - I encountered an 80,556-char // line in real world code during testing - char buf[max_line_len]; + char buf[max_line_len] {0}; public: //----------------------------------------------------------------------- @@ -854,7 +854,6 @@ class source ) : errors{ errors_ } , lines( 1 ) // extra blank to avoid off-by-one everywhere - , buf{0} { } diff --git a/source/parse.h b/source/parse.h index 1ca2c3a492..6249f95a55 100644 --- a/source/parse.h +++ b/source/parse.h @@ -3325,7 +3325,7 @@ struct declaration_node { // Convert the gather_ results to const* auto tmp = gather_type_scope_declarations(w); - return std::vector(tmp.begin(), tmp.end()); + return {tmp.begin(), tmp.end()}; }