Page MenuHomePhabricator

DNS320 (Fabian Thurnheer)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 7 2021, 7:04 AM (58 w, 5 d)

Recent Activity

Jun 11 2021

DNS320 requested review of D104112: [clang-tidy] cppcoreguidelines-avoid-init-default-constructors: a new check.
Jun 11 2021, 5:02 AM · Restricted Project

Jun 10 2021

DNS320 added a comment to D102576: [clang-tidy] cppcoreguidelines-avoid-do-while: a new check.

Friendly Ping.

Jun 10 2021, 8:24 AM · Restricted Project

May 24 2021

DNS320 added a comment to D100092: [clang-tidy] cppcoreguidelines-declare-loop-variable-in-the-initializer: a new check.

Dear reviewers,

May 24 2021, 9:10 AM · Restricted Project

May 19 2021

DNS320 updated the diff for D102576: [clang-tidy] cppcoreguidelines-avoid-do-while: a new check.

I updated the check according to the last review.

May 19 2021, 2:03 AM · Restricted Project

May 16 2021

DNS320 requested review of D102576: [clang-tidy] cppcoreguidelines-avoid-do-while: a new check.
May 16 2021, 4:56 AM · Restricted Project

Apr 30 2021

DNS320 updated the diff for D100092: [clang-tidy] cppcoreguidelines-declare-loop-variable-in-the-initializer: a new check.

Removed a link to the ES.26 C++ Core Guideline in the documentation part.

Apr 30 2021, 8:50 AM · Restricted Project
DNS320 added a comment to D100092: [clang-tidy] cppcoreguidelines-declare-loop-variable-in-the-initializer: a new check.

I implemented something like this recently too. The code I was trying to refactor was something like

auto ii = 0;
for (ii = 0; ii < thing.size(); ++ii)
{
    // code
}
// code
for (ii = 0; ii < thing.size(); ++ii)
{
    // code
}
// code
for (ii = 0; ii < thing.size(); ++ii)
{
    // code
}

ie, the variable was used repeatedly, but always initialized in the loop.

I also had code like

auto ii = 0;
for (ii = 0; ii < thing.size(); ++ii)
{
    // code
}
// code
ii = getNumber();
doSomething(ii);

ie, the next statement referring to ii outside the loop was an assignment, so I could just change it to

for (auto ii = 0; ii < thing.size(); ++ii)
{
    // code
}
// code
auto ii = getNumber();
doSomething(ii);

You don't necessarily have to handle these cases in the initial version of this check, but you could consider them in the future.

Apr 30 2021, 7:13 AM · Restricted Project
DNS320 updated the diff for D100092: [clang-tidy] cppcoreguidelines-declare-loop-variable-in-the-initializer: a new check.

Renamed the IsInsideMatchedForStmt() function according to a comment from the build system.
Changed a data type to "auto" according to a comment from Eugene.Zelenko.

Apr 30 2021, 12:03 AM · Restricted Project

Apr 29 2021

DNS320 added inline comments to D100092: [clang-tidy] cppcoreguidelines-declare-loop-variable-in-the-initializer: a new check.
Apr 29 2021, 6:57 AM · Restricted Project
DNS320 updated the diff for D100092: [clang-tidy] cppcoreguidelines-declare-loop-variable-in-the-initializer: a new check.

I updated the check according to the last review.
The check should now fully implement the defined enforcement chapter from the ES.74 C++ Core Guideline.

Apr 29 2021, 6:55 AM · Restricted Project

Apr 9 2021

DNS320 added a comment to D100092: [clang-tidy] cppcoreguidelines-declare-loop-variable-in-the-initializer: a new check.

Thank you for your reviews.
I will work on your comments and write back soon.

Apr 9 2021, 9:35 AM · Restricted Project

Apr 8 2021

DNS320 requested review of D100092: [clang-tidy] cppcoreguidelines-declare-loop-variable-in-the-initializer: a new check.
Apr 8 2021, 1:03 AM · Restricted Project