Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

JonasToth (Jonas Toth)
User

Projects

User does not belong to any projects.

User Details

User Since
Oct 31 2016, 11:13 AM (361 w, 57 m)

Recent Activity

Sep 26 2022

JonasToth committed rGe66345d54d5f: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is… (authored by JonasToth).
[clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is…
Sep 26 2022, 1:40 AM · Restricted Project, Restricted Project
JonasToth closed D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.
Sep 26 2022, 1:39 AM · Restricted Project, Restricted Project
JonasToth updated the diff for D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.
  • remove unproductive check-fixes line
Sep 26 2022, 1:37 AM · Restricted Project, Restricted Project

Sep 19 2022

JonasToth added a comment to D130181: [clang-tidy] Add readability-use-early-exits check.

...

Your concerns aren't actually that important. Because the transformations only work on for binary operators, and not CXXOperatorCallExpr, it would always never do any special logic, instead just wrap the whole thing in parens and negate it.

Sep 19 2022, 1:59 AM · Restricted Project, Restricted Project

Sep 17 2022

JonasToth added a comment to D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.

ping @njames93 :)

Sep 17 2022, 4:29 AM · Restricted Project, Restricted Project

Sep 4 2022

JonasToth added a comment to D130181: [clang-tidy] Add readability-use-early-exits check.

_Edit_: If overloaded operators are ignored and the check only applies to pointers, int and bool the following is irrelevant. But I did not spot such a guard.
If this is the case, it of course opens the question about at least optional<> types and how to handle those.

Sep 4 2022, 1:40 AM · Restricted Project, Restricted Project

Sep 1 2022

JonasToth added inline comments to D131386: [clang-tidy] Added `ConstAlignment` option to `misc-const-correctness`.
Sep 1 2022, 12:42 AM · Restricted Project, Restricted Project
JonasToth added a comment to D131386: [clang-tidy] Added `ConstAlignment` option to `misc-const-correctness`.

during the original implementation of the fix-util I had the plan to provide an option for east-vs-west const, but during the discussions we came to the conclusion that clang-format should do this (the patches were already pending at that point in time).

Sep 1 2022, 12:39 AM · Restricted Project, Restricted Project

Aug 31 2022

JonasToth added inline comments to D130181: [clang-tidy] Add readability-use-early-exits check.
Aug 31 2022, 6:45 AM · Restricted Project, Restricted Project

Aug 29 2022

JonasToth added a comment to D130181: [clang-tidy] Add readability-use-early-exits check.

just my 2 cents

Aug 29 2022, 6:41 AM · Restricted Project, Restricted Project
JonasToth committed rGb5b750346346: [docs] improve documentation for misc-const-correctness (authored by JonasToth).
[docs] improve documentation for misc-const-correctness
Aug 29 2022, 2:21 AM · Restricted Project, Restricted Project
JonasToth closed D132244: [docs] improve documentation for misc-const-correctness.
Aug 29 2022, 2:21 AM · Restricted Project, Restricted Project
JonasToth added inline comments to D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.
Aug 29 2022, 12:42 AM · Restricted Project, Restricted Project

Aug 26 2022

JonasToth added a comment to D132244: [docs] improve documentation for misc-const-correctness.

@njames93 friendly ping, for https://reviews.llvm.org/D130793 as well :)

Aug 26 2022, 5:23 AM · Restricted Project, Restricted Project

Aug 19 2022

JonasToth updated the summary of D132244: [docs] improve documentation for misc-const-correctness.
Aug 19 2022, 11:09 AM · Restricted Project, Restricted Project
JonasToth updated the diff for D132244: [docs] improve documentation for misc-const-correctness.
  • mention C limitation
Aug 19 2022, 11:07 AM · Restricted Project, Restricted Project
JonasToth updated the diff for D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.
  • remove bad change from diff
Aug 19 2022, 8:56 AM · Restricted Project, Restricted Project
JonasToth updated the diff for D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.
  • split patch
  • remove unnecessary includes
Aug 19 2022, 8:54 AM · Restricted Project, Restricted Project
JonasToth requested review of D132244: [docs] improve documentation for misc-const-correctness.
Aug 19 2022, 8:49 AM · Restricted Project, Restricted Project

Aug 5 2022

JonasToth updated the diff for D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.
  • improve test
Aug 5 2022, 12:43 PM · Restricted Project, Restricted Project
JonasToth updated the diff for D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.
  • add test with typedef
  • [docs] improve documentation for misc-const-correctness
Aug 5 2022, 12:36 PM · Restricted Project, Restricted Project

Jul 30 2022

JonasToth added inline comments to D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.
Jul 30 2022, 2:34 AM · Restricted Project, Restricted Project

Jul 29 2022

JonasToth added reviewers for D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated: hokein, sammccall.
Jul 29 2022, 12:02 PM · Restricted Project, Restricted Project
JonasToth requested review of D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated.
Jul 29 2022, 11:57 AM · Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

This check is enabled by default in LLVM (Checks: misc-* in llvm-project/.clang-tidy)

The warning on mutable non-ref local variables is pretty noisy: a *lot* of existing code does not do this, for defensible reasons (some of us think that the ratio of extra safety to extra syntactic noise for locals is too low). The LLVM style guide doesn't take a position on this.

Should this check

  • be disabled for LLVM? (i.e. this is opt-in for codebases with strong const-correctness rules, LLVM does not, it was unintentionally enabled by misc-*)
  • be configured only to warn on references? (i.e. we expect that is de-facto LLVM style and so uncontroversial)
Jul 29 2022, 9:55 AM · Restricted Project, Restricted Project, Restricted Project

Jul 24 2022

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

Thank you very much for all you patience, reviews and tests!
I hope that the following improvements are now simpler to integrate and that the test matures well. :)

Jul 24 2022, 10:40 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth committed rG46ae26e7eb70: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to… (authored by JonasToth).
[clang-tidy] implement new check 'misc-const-correctness' to add 'const' to…
Jul 24 2022, 10:39 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth closed D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Jul 24 2022, 10:39 AM · Restricted Project, Restricted Project, Restricted Project

Jul 10 2022

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

@njames93 @LegalizeAdulthood I did integrate the requested changes regarding warning for bad configs, refactoring of map-access and the directory structure of test-files and documentation.

Jul 10 2022, 4:23 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • refactor: adjust warning message for mis-configuration to show which check is configured wrong
Jul 10 2022, 2:44 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • fix: doc list and release-notes reference
Jul 10 2022, 2:36 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

Clang-tidy tests and docs have been moved to subdirectories by module, please rebase to main:HEAD

Jul 10 2022, 2:33 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Jul 10 2022, 2:32 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • test: move tests into group specific directory
  • refactor: use more idiomatic c++ for scope-based analyzer creation/access
  • feat: provide config validation if analysis if completely configured off
  • refactor: move documentation as well
  • test: add test for incorrect configurations
Jul 10 2022, 2:32 AM · Restricted Project, Restricted Project, Restricted Project

Jun 8 2022

JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Jun 8 2022, 6:18 AM · Restricted Project, Restricted Project, Restricted Project

Jun 7 2022

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

ping :)
@njames93 I added more CHECK-FIXES and CHECK-FIXES-NOT statements in the tests.

Jun 7 2022, 1:13 AM · Restricted Project, Restricted Project, Restricted Project

Jun 4 2022

JonasToth added inline comments to D127036: [clang-tidy] Warn about arrays in `bugprone-undefined-memory-manipulation`.
Jun 4 2022, 11:54 AM · Restricted Project, Restricted Project

May 29 2022

JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • addded CHECK-FIXES in clang-tidy tests
  • merged latest main into branch
May 29 2022, 2:48 AM · Restricted Project, Restricted Project, Restricted Project

May 20 2022

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

friendly ping :) (maybe @njames93 ?)

May 20 2022, 4:32 AM · Restricted Project, Restricted Project, Restricted Project

May 6 2022

JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • fix documentation reference
May 6 2022, 7:06 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
May 6 2022, 5:55 AM · Restricted Project, Restricted Project, Restricted Project

May 5 2022

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

Thank you for the review! I adjusted the patch.

May 5 2022, 1:19 PM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • addressing review comments and remove unrelated changes
May 5 2022, 1:13 PM · Restricted Project, Restricted Project, Restricted Project

Apr 24 2022

JonasToth retitled D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables from [clang-tidy] implement const-transformation for misc-const-correctness to [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Apr 24 2022, 9:50 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • fix: remove clangAnalysis link in cppcoreguidelines and add it in misc
Apr 24 2022, 9:48 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth retitled D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables from [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness to [clang-tidy] implement const-transformation for misc-const-correctness.
Apr 24 2022, 9:46 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • refactor: rename check to 'misc-const-correctness' and adjust the tests accordingly
  • docs: adjust release notes and adjust check docs slightly
Apr 24 2022, 9:45 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added a comment to D119481: run-clang-tidy: Fix infinite loop on windows.

Sorry for the long delay, i simply forgot.
The patch is commited! :)

Apr 24 2022, 8:18 AM · Restricted Project, Restricted Project
JonasToth committed rG3f0f20366622: run-clang-tidy: Fix infinite loop on windows (authored by JonasToth).
run-clang-tidy: Fix infinite loop on windows
Apr 24 2022, 8:18 AM · Restricted Project, Restricted Project
JonasToth closed D119481: run-clang-tidy: Fix infinite loop on windows.
Apr 24 2022, 8:18 AM · Restricted Project, Restricted Project

Mar 28 2022

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

ok. then i will continue under misc-const-correctness. thank you for the clarifications!

Mar 28 2022, 3:29 AM · Restricted Project, Restricted Project, Restricted Project

Mar 25 2022

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

Sorry, for my own sanity, I've stopped reviewing C++ Core Guideline reviews for their diagnostic behavior until the guideline authors put effort into specifying realistic enforcement guidance.

Mar 25 2022, 5:18 AM · Restricted Project, Restricted Project, Restricted Project

Mar 20 2022

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

ping @aaron.ballman @njames93 :)

Mar 20 2022, 1:27 AM · Restricted Project, Restricted Project, Restricted Project

Mar 2 2022

JonasToth accepted D120331: [clang-tidy][run-clang-tidy.py] Add --config-file=<string> option.

LGTM, but please adjust the naming nit to a better name.

Mar 2 2022, 3:41 AM · Restricted Project, Restricted Project

Feb 22 2022

JonasToth added inline comments to D120331: [clang-tidy][run-clang-tidy.py] Add --config-file=<string> option.
Feb 22 2022, 2:51 PM · Restricted Project, Restricted Project

Feb 21 2022

JonasToth abandoned D54141: [clang-tidy] add deduplication support for run-clang-tidy.py.

won't happen anymore realistically.

Feb 21 2022, 9:26 AM · Restricted Project, Restricted Project
JonasToth accepted D119481: run-clang-tidy: Fix infinite loop on windows.

LGTM with a small nit.

Feb 21 2022, 9:23 AM · Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

Another full run on LLVM with:

Feb 21 2022, 5:10 AM · Restricted Project, Restricted Project, Restricted Project

Feb 20 2022

JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Feb 20 2022, 1:10 PM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • address reviews comments, part 1
  • Merge branch 'main' into feature_rebase_const_transform_20210808
  • fixing iterator-to-bool conversion and addressing other more review comments
Feb 20 2022, 1:08 PM · Restricted Project, Restricted Project, Restricted Project

Feb 7 2022

JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Feb 7 2022, 12:25 AM · Restricted Project, Restricted Project, Restricted Project

Feb 4 2022

JonasToth added inline comments to D118927: [clang-tidy] Fix invalid fix-it for cppcoreguidelines-prefer-member-initializer.
Feb 4 2022, 3:55 AM · Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

@aaron.ballman - can this land for Clang14, or does it have wait for 15?

Are there any other reviewers that can approve this?

Feb 4 2022, 2:44 AM · Restricted Project, Restricted Project, Restricted Project

Feb 2 2022

JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Feb 2 2022, 7:07 AM · Restricted Project, Restricted Project, Restricted Project

Feb 1 2022

JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Feb 1 2022, 1:52 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Feb 1 2022, 1:49 AM · Restricted Project, Restricted Project, Restricted Project

Jan 29 2022

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

ping @aaron.ballman just in case the patch is now down on the list, I am sorry for my high latency :(

Jan 29 2022, 12:30 PM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • use boolean for options
  • fix snafoo on arc usage
Jan 29 2022, 12:28 PM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • use boolean for option parsing
Jan 29 2022, 12:25 PM · Restricted Project, Restricted Project, Restricted Project

Jan 15 2022

JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • fix: adjust unit test for new array-pointer condition in range-based for loops
Jan 15 2022, 9:11 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • fix release note ordering
Jan 15 2022, 8:31 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • improve documentation a bit
Jan 15 2022, 8:30 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

addressed all outstanding review comments.

Jan 15 2022, 8:27 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • Merge branch 'main' into feature_rebase_const_transform_20210808
  • fix: address other review comments
  • remove one false positive with pointers in a range-based for loop on arrays
Jan 15 2022, 8:17 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Jan 15 2022, 7:21 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • Merge branch 'main' into feature_rebase_const_transform_20210808
  • fix: fixes for most review comments
Jan 15 2022, 7:20 AM · Restricted Project, Restricted Project, Restricted Project

Dec 15 2021

JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Dec 15 2021, 7:14 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

Thanks for pinging on this, it had fallen off my radar! @JonasToth -- did you ever get the chance to talk with @cjdb about the overlap mentioned in https://reviews.llvm.org/D54943#2950100? (The other review also seems to have stalled out, so I'm not certain where things are at.)

Dec 15 2021, 4:55 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

@aaron.ballman ping for review :)

Dec 15 2021, 4:38 AM · Restricted Project, Restricted Project, Restricted Project

Oct 7 2021

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

ping

Oct 7 2021, 11:43 AM · Restricted Project, Restricted Project, Restricted Project

Sep 5 2021

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

I analyzed the false positive and its probably not so simple to fix.

Sep 5 2021, 9:45 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • add reproducer for '__unaligned' bug
Sep 5 2021, 9:35 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

I am getting false positives with

struct S{};

void f(__unaligned S*);

void scope()
{
	S s;
	f(&s);
}
Sep 5 2021, 8:53 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • Merge branch 'main' into feature_rebase_const_transform_20210808
Sep 5 2021, 8:35 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • minor adjustments for comments
Sep 5 2021, 8:33 AM · Restricted Project, Restricted Project, Restricted Project

Aug 23 2021

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

thanks for your testing! i will look at the __unaligned issue, not sure if clang supports it, its an MSVC extension, is it?

Aug 23 2021, 1:16 AM · Restricted Project, Restricted Project, Restricted Project

Aug 17 2021

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

@JonasToth, @aaron.ballman suspects that there's enough overlap between this patch and D107873 to consider merging the two efforts. I'm happy to collaborate, but we should probably check that our goals are aligned. Are you active on the LLVM Discord? We could probably discuss a fair bit of this offline and then ping Aaron after we work out whether or not to do this.

Aug 17 2021, 11:38 AM · Restricted Project, Restricted Project, Restricted Project

Aug 15 2021

JonasToth added inline comments to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
Aug 15 2021, 12:19 PM · Restricted Project, Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

The check in the latest form can properly transform llvm/lib and clang/ and requires 28 manual fixes afterwards (values and references are transformed, no other modifications).
Some are good and not an issue with the analysis itself, some may or may not be an issue with the analysis itself. I think it is more a template meta programming thing.

Aug 15 2021, 12:16 PM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • fix: auto and type-dependent initializers fixed by ignoring them correctly in the matcher
  • fix docs on limitations
  • fix: deduplicate diagnostics from template instantiations
Aug 15 2021, 11:59 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth retitled D107900: [clang-tidy] Add a new clang-tidy check for trivially copyable types passed by const reference from Add a new clang-tidy check for trivially copyable types passed by const reference to [clang-tidy] Add a new clang-tidy check for trivially copyable types passed by const reference.
Aug 15 2021, 3:10 AM · Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • write documentation for const-analysis check
Aug 15 2021, 3:07 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth retitled D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables from WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness to [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness.
Aug 15 2021, 1:12 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • Merge branch 'main' into feature_rebase_const_transform_20210808
Aug 15 2021, 1:11 AM · Restricted Project, Restricted Project, Restricted Project
JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

Using the checker now in our production BuildBot - no crashes and no false positives. Can't say if there are false negatives, but at any rate the checker is better than most colleagues at finding what should be declared const.

Aug 15 2021, 1:05 AM · Restricted Project, Restricted Project, Restricted Project

Aug 9 2021

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

Whats left from my personal todo is adjusting the documentation.
I think then this check can work as linter and if you want as fixer as well, but this has to be enable explicitly.

Aug 9 2021, 12:22 PM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • remove transformation as default option, now it must be activated by the user explicitly
  • register only for C++
  • add a test-case for VLAs
Aug 9 2021, 12:20 PM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • retry upload of patch to be a diff to main
Aug 9 2021, 12:07 PM · Restricted Project, Restricted Project, Restricted Project
JonasToth updated the diff for D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.
  • rebase to master
  • fix a crash where a scope matched but non of its variables, leading to nullptr dereference (found with the current test-suite)
  • remove outcommenting of tests that showed undesirable behavior
Aug 9 2021, 12:05 PM · Restricted Project, Restricted Project, Restricted Project

Aug 8 2021

JonasToth added a comment to D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables.

Can we get this in? I work in Microsoft Office and we have been using this checker and it works great! There are a couple of issues with it and I would like to contribute fixes.

Aug 8 2021, 4:05 AM · Restricted Project, Restricted Project, Restricted Project