Skip to content

Commit

Permalink
clang-tidy: modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
farmerpiki committed Aug 21, 2024
1 parent f823181 commit 91b56fd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion source/cppfront.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<long long> > 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});
}
Expand Down
3 changes: 1 addition & 2 deletions source/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
//-----------------------------------------------------------------------
Expand All @@ -854,7 +854,6 @@ class source
)
: errors{ errors_ }
, lines( 1 ) // extra blank to avoid off-by-one everywhere
, buf{0}
{
}

Expand Down
2 changes: 1 addition & 1 deletion source/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -3325,7 +3325,7 @@ struct declaration_node
{
// Convert the gather_ results to const*
auto tmp = gather_type_scope_declarations(w);
return std::vector<declaration_node const*>(tmp.begin(), tmp.end());
return {tmp.begin(), tmp.end()};
}


Expand Down

0 comments on commit 91b56fd

Please sign in to comment.