Skip to content

Commit 91b56fd

Browse files
committed
clang-tidy: modernize
1 parent f823181 commit 91b56fd

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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'
1+
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'

source/cppfront.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ auto main(
137137
auto total_time = print_with_thousands(t.elapsed().count());
138138
std::cout << "\n Time " << total_time << " ms";
139139

140-
std::multimap< long long, std::string_view, std::greater<long long> > sorted_timers;
140+
std::multimap< long long, std::string_view, std::greater<> > sorted_timers;
141141
for (auto [name, t] : timers) {
142142
sorted_timers.insert({t.elapsed().count(), name});
143143
}

source/io.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ class source
841841
static const int max_line_len = 90'000;
842842
// do not reduce this - I encountered an 80,556-char
843843
// line in real world code during testing
844-
char buf[max_line_len];
844+
char buf[max_line_len] {0};
845845

846846
public:
847847
//-----------------------------------------------------------------------
@@ -854,7 +854,6 @@ class source
854854
)
855855
: errors{ errors_ }
856856
, lines( 1 ) // extra blank to avoid off-by-one everywhere
857-
, buf{0}
858857
{
859858
}
860859

source/parse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3325,7 +3325,7 @@ struct declaration_node
33253325
{
33263326
// Convert the gather_ results to const*
33273327
auto tmp = gather_type_scope_declarations(w);
3328-
return std::vector<declaration_node const*>(tmp.begin(), tmp.end());
3328+
return {tmp.begin(), tmp.end()};
33293329
}
33303330

33313331

0 commit comments

Comments
 (0)