[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-03-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > 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. And how can we continue now? I fear that this is effectively the deat

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-03-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. ok. then i will continue under `misc-const-correctness`. thank you for the clarifications! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 ___

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#3681527 , @sammccall wrote: > 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

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-07-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: njames93, aaron.ballman, alexfh. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a project: All. JonasToth requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commit

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-07-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-pointer-as-values.cpp:16 +void range_for() { + int np_local0[2] = {1, 2}; + int *p_local0[2] = {&np_local0[0], &np_local0[1]}; the tests must be exan

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-08-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 450358. JonasToth added a comment. - add test with typedef - [docs] improve documentation for misc-const-correctness Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130793/new/ https://reviews.llvm.org/D130793

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-08-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 450359. JonasToth added a comment. - improve test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130793/new/ https://reviews.llvm.org/D130793 Files: clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.c

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-03-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. ping @aaron.ballman @njames93 :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#3292552 , @0x8000- wrote: > @aaron.ballman - can this land for Clang14, or does it have wait for 15? > > Are there any other reviewers that can approve this? Sadly, cherry-picking to 14 is very unlikely, as this is

[PATCH] D118927: [clang-tidy] Fix invalid fix-it for cppcoreguidelines-prefer-member-initializer

2022-02-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer.cpp:550 + // CHECK-FIXES-NEXT: } + PR53515(PR53515 &&Other) : M() { +M = Other.M; could you please add a test-case for initi

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt:33 LINK_LIBS + clangAnalysis clangTidy njames93 wrote: > Will this work under clangd as I don't think that links in the clangAnalysis > libraries @s

[PATCH] D119481: run-clang-tidy: Fix infinite loop on windows

2022-04-24 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3f0f20366622: run-clang-tidy: Fix infinite loop on windows (authored by JonasToth). Herald added a project: All. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D119481: run-clang-tidy: Fix infinite loop on windows

2022-04-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Sorry for the long delay, i simply forgot. The patch is commited! :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119481/new/ https://reviews.llvm.org/D119481 ___ cfe-commits

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-04-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 424787. JonasToth added a comment. - refactor: rename check to 'misc-const-correctness' and adjust the tests accordingly - docs: adjust release notes and adjust check docs slightly Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

[PATCH] D54943: [clang-tidy] implement const-transformation for misc-const-correctness

2022-04-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 424788. JonasToth added a comment. - fix: remove clangAnalysis link in cppcoreguidelines and add it in misc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files: c

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 427423. JonasToth marked 3 inline comments as done. JonasToth added a comment. - addressing review comments and remove unrelated changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://review

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added a comment. Thank you for the review! I adjusted the patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 ___

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.h:24 +/// For the user-facing documentation see: +/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-const.html +class ConstCorrectnessCheck : public ClangTidyChe

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 427629. JonasToth added a comment. - fix documentation reference Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files: clang-tools-extra/clang-tidy/misc/CMakeLists

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 443486. JonasToth added a comment. - refactor: adjust warning message for mis-configuration to show which check is configured wrong Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.ll

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @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. given the high interest in the patch and the need to iron out potential false-

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-24 Thread Jonas Toth via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG46ae26e7eb70: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to… (authored by JonasToth). Repo

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. 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. :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. friendly ping :) (maybe @njames93 ?) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D36051: [clang-tidy] List the checkers with autofix

2017-07-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. would be a classification of checks in general interesting? i could think of "quality", some checks might be heuristic, some might be new and have some bugs, and some might catch everything correct and handle it perfectly. So checks could have 2 categories: -> autof

[PATCH] D36051: [clang-tidy] List the checkers with autofix

2017-08-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In my opinion, this list should be available to the executable for two reasons. 1. External tools, that want to integrate clang-tidy in their workflow should be able to get the information about fixits, since they could collidie with their own textual replacements 2.

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 110547. JonasToth marked 10 inline comments as done. JonasToth added a comment. [Misc] address issues from aaron, especially refactor the big check function https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 110548. JonasToth added a comment. [Fix] typo https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp clang-

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 110617. JonasToth added a comment. [Misc] remove unneccessary stuff https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/OwningMe

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp:149 + // Deletion of non-owners, with `delete variable;` + if (DeletedVariable != nullptr) { +assert(DeleteStmt != nullptr && aaron.ballman wrote: > Can `Deleted

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 110730. JonasToth marked 6 inline comments as done. JonasToth added a comment. - order release notes - address aarons comments - adjust diagnostic for function arguments https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp:188 +diag(OwnerAssignment->getLocStart(), + "assigning neither an owner nor a recognized resource") +<< SourceRange(Owne

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 110731. JonasToth added a comment. remove manual source range creation, where i forgot it before https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-ti

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 5 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp:230 +<< BadOwnerInitialization->getSourceRange(); +// FIXME FixitHint to rewrite the type if possible + aaron.b

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 110799. JonasToth marked an inline comment as done. JonasToth added a comment. address review comments from aaron https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModu

[PATCH] D36836: [clang-tidy] Implement readability-function-cognitive-complexity check

2017-08-18 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Did I run it over clang or athletic like that? I would be interested in an overall output. I added my thoughts. This check seems very valuable. Comment at: clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp:23 + // Limit of 25 is the "upstr

[PATCH] D37014: [clang-tidy] Add a checker to remove useless intermediate variables before return statements with comparisons

2017-08-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Hi :) I added my thoughts for the check. Many variables in your code could be `const`, i didn't mention all cases. Comment at: clang-tidy/readability/UselessIntermediateVarCheck.cpp:24 + + auto directDeclRefExprLHS1 = +// We match a direct decl

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added a comment. improved structure a bit https://reviews.llvm.org/D36354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 112336. JonasToth added a comment. - test case fixed expected warning - address review comments from aaron https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 112363. JonasToth marked 3 inline comments as done. JonasToth added a comment. - adjust the diagnostics to include the types https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuideli

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. i think the diagnostics are better now, i added the expected and received type everywhere i could. https://reviews.llvm.org/D36354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mail

[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

2017-08-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 112364. JonasToth added a comment. remove unnecessary outcommented lines https://reviews.llvm.org/D36354 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/Own

[PATCH] D36586: [clang-tidy] hicpp bitwise operations on signed integers

2017-08-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/hicpp/SignedBitwiseCheck.cpp:23 + const auto SignedIntegerOperand = + expr(ignoringImpCasts(hasType(isSignedInteger(.bind("signed_operand"); + aaron.ballman wrote: > JonasToth wrote: > > aaron.bal

[PATCH] D36586: [clang-tidy] hicpp bitwise operations on signed integers

2017-08-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 112572. JonasToth added a comment. - get up to date with master - added testcase for enums https://reviews.llvm.org/D36586 Files: clang-tidy/hicpp/CMakeLists.txt clang-tidy/hicpp/HICPPTidyModule.cpp clang-tidy/hicpp/SignedBitwiseCheck.cpp clang-ti

[PATCH] D36586: [clang-tidy] hicpp bitwise operations on signed integers

2017-08-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 112573. JonasToth added a comment. - fix indendation in testcase https://reviews.llvm.org/D36586 Files: clang-tidy/hicpp/CMakeLists.txt clang-tidy/hicpp/HICPPTidyModule.cpp clang-tidy/hicpp/SignedBitwiseCheck.cpp clang-tidy/hicpp/SignedBitwiseChec

[PATCH] D31370: [clang-tidy] Prototype to check for exception specification

2017-08-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth abandoned this revision. JonasToth added a comment. exception checking seems to end in the front end for such cases, so nothing to do here anymore. reimplement if there is need later. Repository: rL LLVM https://reviews.llvm.org/D31370 ___

[PATCH] D57662: [clang-tidy] Parallelize clang-tidy-diff.py

2019-12-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D57662#1797607 , @derek wrote: > @zinovy.nis @alexfh @JonasToth @MyDeveloperDay > > Hi folks, please correct me if I'm wrong but it appears that an effect of > this change is that this script will no longer exit non-zero if `

[PATCH] D71980: [clang-tidy] Disable Checks on If constexpr statements in template Instantiations for BugproneBranchClone, ReadabilityBracesAroundStatements and ReadabilityMisleadingIndentation

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Thank you for working on this! In D71980#1798680 , @njames93 wrote: > In D71980#1798517 , @lebedev.ri > wrote: > > > Missing tests; please upload patches with full context (`-U9`); j

[PATCH] D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/SuspiciousMemoryComparisonCheck.cpp:19 + +static constexpr llvm::StringLiteral CallExprName = "call"; + I think you can remove the constant and hardcode it in the matcher. that is

[PATCH] D70265: [clang-tidy] Add clang tidy check I.2 to cppcoreguidelines

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.cpp:110 + "making it const") + << MemberVariable; // FIXME: Add fix-it hint to MemberVariable +} missing `return`

[PATCH] D65912: [clang-tidy] Add new check for math constants

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Herald added a subscriber: whisperity. In D65912#1623375 , @ZaMaZaN4iK wrote: > > ... then I have a script that runs clang-tidy over all the compilation > > units in a compilation database > > Can you share this script please? :

[PATCH] D63324: [clang-tidy] Replace memcpy by std::copy

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Herald added subscribers: wuzish, whisperity. You need tests for this check. Please harden them against macro-interference as well. I think the transformation should happen as function call that return `Optional` and if any failure happens the diagnostic can still be e

[PATCH] D61989: [clang-tidy] enable modernize-concat-nested-namespaces on header files

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Sorry for not responding to the review. I was very busy with other things and overlooked the mails :( Comment at: clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:82 ast_matchers::MatchFinder *Finder) { - if (!getLangOpts

[PATCH] D45444: [clang-tidy] implement new check for const-correctness

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth abandoned this revision. JonasToth added a comment. Herald added a subscriber: whisperity. Abonding this revision in favor of: https://reviews.llvm.org/D54943 It doesn't make sense to have both open at the same time, as the const-transformation happens in its own patch and no heavy lift

[PATCH] D70265: [clang-tidy] Add clang tidy check I.2 to cppcoreguidelines

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. There are many comments not marked as done. could you please do that with addressed issues? It is hard to otherwise see whats still left. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.cpp:110 +

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 235610. JonasToth marked 14 inline comments as done. JonasToth added a comment. - create fresh branch with latest diff of the revision - fix review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54395/

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp:34-41 +static bool isArrayType(QualType QT) { return isa(QT.getTypePtr()); } +static bool isReferenceType(QualType QT) { + return isa(QT.getTypePtr()); +} +static bool isPointerTy

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2019-12-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 235611. JonasToth added a comment. - fix brace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54395/new/ https://reviews.llvm.org/D54395 Files: clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp

[PATCH] D36051: Move from a long list of checkers to tables

2019-12-31 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D36051#1799785 , @sylvestre.ledru wrote: > @malcolm.parsons really? Oh, where is it implemented? > > https://github.com/llvm/llvm-project/blob/61504079515f76ca094bb836c4d53b41064220d6/clang-tools-extra/clang-tidy/modernize

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2019-12-31 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 235703. JonasToth added a comment. - improve test situation and fix a crash coming from invalid source locations Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54395/new/ https://reviews.llvm.org/D54395 Files

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2019-12-31 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 235704. JonasToth added a comment. - adjust skipLParens code slightly to remove redundant checks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54395/new/ https://reviews.llvm.org/D54395 Files: clang-tools-

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2019-12-31 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 235705. JonasToth added a comment. - clarify FIXME problem Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54395/new/ https://reviews.llvm.org/D54395 Files: clang-tools-extra/clang-tidy/performance/ForRangeC

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2020-01-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/AddConstTest.cpp:66 + StringRef S = "MyInt target = 0;"; + auto Cat = [&T](StringRef S) { return (T + S).str(); }; + aaron.ballman wr

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2020-01-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 235838. JonasToth marked 3 inline comments as done. JonasToth added a comment. - address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54395/new/ https://reviews.llvm.org/D54395 Files: clan

[PATCH] D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check

2020-01-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-suspicious-memory-comparison.cpp:1 +// RUN: %check_clang_tidy %s bugprone-suspicious-memory-comparison %t + gbencze wrote: > JonasToth wrote: > > We should explicitl

[PATCH] D71973: [clang-tidy] Add bugprone-suspicious-memory-comparison check

2020-01-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. LG from my side, besides the small nits. Please let @aaron.ballman have a look as well. thanks for the patch :) Comment at: clang-tools-extra/clang-tidy/bugprone/SuspiciousMemoryComparisonCheck.cpp:45 + + // check if comparing padding in base +

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2020-01-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 6 inline comments as done. JonasToth added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/AddConstTest.cpp:1006 +} + +} // namespace test aaron.ballman wrote: > JonasToth wrote: > > aaron.ballman wrote: > > > Can you also add

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2020-01-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 235938. JonasToth added a comment. - add proper objc test, that fail mostly Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54395/new/ https://reviews.llvm.org/D54395 Files: clang-tools-extra/clang-tidy/perf

[PATCH] D72121: [clang-tidy] Fix readability-identifier-naming missing member variables

2020-01-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Thank you for fixing these bugs! Did you try running the check of clang/llvm again, to see if there are still missing cases of this? Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:575 -if (Decl->isFileVarDecl()

[PATCH] D72121: [clang-tidy] Fix readability-identifier-naming missing member variables

2020-01-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D72121#1803242 , @njames93 wrote: > Ahh clang format script must have run, I'll undo that. I've not tried running > it against the whole of llvm as I don't know what the easy way to do that is, > especially given that llvm d

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2020-01-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/AddConstTest.cpp:1055 + EXPECT_NE(runCheckOnCode(Cat(S), nullptr, "input.m"), +Cat("Object const*target;")); + EXPECT_NE(runCheckOnCode(C

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2020-01-03 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcf48101200ee: [clang-tidy] implement utility-function to add 'const' to variables (authored by JonasToth). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D5439

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2020-01-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Thank you for all the review over the time this took to land! :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54395/new/ https://reviews.llvm.org/D54395 ___ cfe-commits mail

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1800182 , @0x8000- wrote: > F11163406: 0001-Add-extra-tests.patch > shows a couple of false positives. I added your tests, but some did not show false positives anymore. I thi

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 236101. JonasToth added a comment. - ignore implicit casts in memberExpr(hasObjectExpression()) - implement functionality for function pointers Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https:/

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5224 +/// Matches QualType nodes that are of function pointer type. +/// I will remove those later. They are not used. Tidying

[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

2020-01-03 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54395#1803552 , @thakis wrote: > This breaks tests on Windows: http://45.33.8.238/win/5061/step_8.txt > > Please take a look, and if takes a while to investigate, please revert in the > meantime. (Probably needs the fno-dela

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-values.cpp:608 +} + +template 0x8000- wrote: > Please insert the this test code here: >

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-values.cpp:608 +} + +template JonasToth wrote: > 0x8000- wrote: > > Please insert the thi

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1804183 , @0x8000- wrote: > This patch does not build on top of current tree: > > /usr/bin/ld: > lib/libclangTidyCppCoreGuidelinesModule.a(ConstCorrectnessCheck.cpp.o): in > function > `clang::tidy::cppcoreguid

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-values.cpp:608 +} + +template 0x8000- wrote: > 0x8000- wrote: > > JonasToth wrote: >

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-values.cpp:608 +} + +template 0x8000- wrote: > JonasToth wrote: > > 0x8000- wrote: >

[PATCH] D56644: [clang-tidy] readability-container-size-empty handle std::string length()

2020-01-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Herald added a subscriber: mgehre. any news here? do you plan to finish this patch @Quolyk ? Do you mind if someone comandeers this patch? Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56644/new/ https://reviews.llvm.org/D

[PATCH] D72213: [clang-tidy] Add `bugprone-reserved-identifier` to flag usages of reserved C++ names

2020-01-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. i think it would be easier to review if there are two patches, one refactoring and one new check. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.h:59 + struct FailureInfo { +std::string KindName; // Tag or misc info to be u

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 4 inline comments as done. JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-values.cpp:608 +} + +template JonasToth wrote: > 0x8000- wrote: > > JonasToth wrote: > >

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 236253. JonasToth added a comment. - find more false positives - fix false positive with refernces to containers in range-for. This introduces false negative though - new test-case for check - fix range-for iterator speciality; start working on complex cond

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. `clang/lib` almost transforms cleanly. issues still left: - `InitListExpr` can initialize non-const references. Such cases are not figured out yet (see `create_false_positive` at the end of the testcases) - I found a case in clang, where `const` was correctly added to

[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. +1 for the check from me as well :) Comment at: clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp:19 + if (!getLangOpts().CPlusPlus) { +// auto deduction not used in c +return; Please make the comments full sent

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1804890 , @0x8000- wrote: > I can't build this on top of current llvm-project tree > (6a6e6f04ec2cd2f4f07ec4943036c5c2d47ce0c7 > ): > > /usr/b

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1804905 , @0x8000- wrote: > In D54943#1804904 , @JonasToth wrote: > > > In D54943#1804890 , @0x8000- > > wrote: > > > > > I can'

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 236259. JonasToth added a comment. - Merge branch 'master' into feature_transform_const.patch - link clangAnalysis to the cppcoreguidelines-module - fix InitListExpr as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1805108 , @0x8000- wrote: > In D54943#1804943 , @JonasToth wrote: > > > - Merge branch 'master' into feature_transform_const.patch > > - link clangAnalysis to the cppcoreguid

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-01-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 236339. JonasToth added a comment. - fix false positive with parenListExpr, dont match so narrow for them - try removing more false positives, does not work Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/

[PATCH] D72284: [clang-tidy] Factor out renaming logic from readability-identifier-naming

2020-01-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I guess all the tests run? I think this LGTM after the nits are adressed. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp:203 + Decl = Ref.getDecl(); +} + What about the else? If it is unreachable it

[PATCH] D72282: [clang-tidy] Add `bugprone-unintended-adl`

2020-01-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UnintendedADLCheck.cpp:43 + Whitelist( + utils::options::parseStringList(Options.get("Whitelist", "swap"))) {} + do you mean `std::swap`? If you it should be fully qu

[PATCH] D72284: [clang-tidy] Factor out renaming logic from readability-identifier-naming

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp:272 + if (const auto *Typedef = + Value->getReturnType().getTypePtr()->getAs()) { +addUsage(NamingCheckFailures, Typedef->getDecl(), ---

[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp:61 + Diag << FixItHint::CreateReplacement( + FixItRange, IsPtrConst ? "const auto *const " : "auto *const "); +} else { njames93 wrote:

[PATCH] D72284: [clang-tidy] Factor out renaming logic from readability-identifier-naming

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. i am still fine with the patch. if no one else has objections, i think this can land. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72284/new/ https://reviews.llvm.org/D72284 __

[PATCH] D72282: [clang-tidy] Add `bugprone-unintended-adl`

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UnintendedADLCheck.cpp:43 + Whitelist( + utils::options::parseStringList(Options.get("Whitelist", "swap"))) {} + logan-5 wrote: > JonasToth wrote: > > do you mean `st

[PATCH] D72333: [clang-tidy] Disable match on `if constexpr` statements in template instantiation for `readability-misleading-indentation` check.

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp:172 +void call() { + mustPass(); + mustPass(); please add an case that does not get instantiated, with both bad and good indentation

<    6   7   8   9   10   11   12   13   14   15   >