[PATCH] D147889: [clang-tidy] Improve bugprone-branch-clone with support for fallthrough attribute

2023-05-23 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG77f191e81ed4: [clang-tidy] Improve bugprone-branch-clone with support for fallthrough… (authored by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D151133: [clang-tidy] Ignore implicit code in bugprone-branch-clone

2023-05-23 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG42c83e32706e: [clang-tidy] Ignore implicit code in bugprone-branch-clone (authored by PiotrZSL). Changed prior to commit: https://reviews.llvm.org/D151133?vs=524764&id=524845#toc Repository: rG LLVM

[PATCH] D151383: [clang-tidy] Check for specific return types on all functions

2023-05-25 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL requested changes to this revision. PiotrZSL added a comment. This revision now requires changes to proceed. - Missing tests - Missing release notes - Missing check documentation update Comment at: clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp:159

[PATCH] D151431: [clang-tidy] Add check bugprone-unique-ptr-array-mismatch.

2023-05-25 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. This revision is now accepted and ready to land. LGTM, But: - Align check description before committing. - Consider adding some test with std::unique_ptr behind typedef. - Consider adding test with unique_ptr depend on template argument b

[PATCH] D151495: [clang-tidy] Improve build-in type handling in bugprone-swapped-arguments

2023-05-25 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. PiotrZSL added reviewers: bkramer, njames93, carlosgalvezp. Herald added a subscriber: xazax.hun. Herald added a project: All. PiotrZSL requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Improved det

[PATCH] D151383: [clang-tidy] Check for specific return types on all functions

2023-05-26 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp:159 + anyOf(isInstantiatedFrom(hasAnyName(FunVec)), + hasAnyReturnType(RetTypeVec) .bind("match";

[PATCH] D151431: [clang-tidy] Add check bugprone-unique-ptr-array-mismatch.

2023-05-26 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. In D151431#4376181 , @balazske wrote: > Maybe we can remove the warning in all cases when the type is a POD type (or > add a check option)? **Leave it... **From a user perspective, it doesn't ma

[PATCH] D151051: [clang-tidy] Optimize misc-confusable-identifiers

2023-05-26 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2a84c635f2a1: [clang-tidy] Optimize misc-confusable-identifiers (authored by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151051/new/ https://re

[PATCH] D151383: [clang-tidy] Check for specific return types on all functions

2023-05-26 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp:129 + CheckedReturnTypes(utils::options::parseStringList( + Options.get("Ch

[PATCH] D151383: [clang-tidy] Check for specific return types on all functions

2023-05-26 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. LGTM, you may consider reducing commit message (aka review description by removing example and error from it, and leaving just plain description of a change). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D151594: [clang-tidy] Optimize misc-confusable-identifiers

2023-05-26 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. PiotrZSL added reviewers: serge-sans-paille, carlosgalvezp, njames93. Herald added a subscriber: xazax.hun. Herald added a project: All. PiotrZSL requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Th

[PATCH] D148697: [clang-tidy] Add more checks for functions which should be noexcept

2023-05-28 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. This revision is now accepted and ready to land. On first glance, looks fine, but I didn't check it too deep. Leave it open for 1-2 weeks. I will try to check it more deeply. One thing that I see and do not like is duplication, maybe we c

[PATCH] D147417: [clang-tidy] Do not emit bugprone-exception-escape warnings from coroutines

2023-05-29 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. This revision is now accepted and ready to land. LGTM - Missing release notes entry. - I'm not sure about change in StmtCXX.h, do we need it ? Coudn't we just use children() + getBody() - CHECK-MESSAGES-NOT get me a little bit confused.

[PATCH] D151650: [clang-tidy] Update UnusedReturnValueCheck types

2023-05-29 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. LGTM but update documentation for this check abseil::Status is listed there. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151650/new/ https://reviews.llvm.org/D151650 ___ cfe-commits mailing list cfe-commits@lists.l

[PATCH] D151650: [clang-tidy] Update UnusedReturnValueCheck types

2023-05-29 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst:53 By default the following function return types are checked: - `::std::error_code`, `::std::expected`, `::boost::system::error_code`, `::abseil::Status`

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-05-30 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Not too bad, you on a right road. Tests failed on windows, and clang-format failed. Comment at: clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp:86 + llvm::SmallVector MainFileDecls; + for (auto *D : Result.Nodes.getNodeAs("top")->decls())

[PATCH] D148793: [clang-tidy] Implement an include-cleaner check.

2023-05-30 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/IncludeCleanerTest.cpp:9 +#include + +using namespace clang::tidy::misc; PiotrZSL wrote: > this test file is fine, but there is no validation of output warning. > nwm, somehow I

[PATCH] D147417: [clang-tidy] Do not emit bugprone-exception-escape warnings from coroutines

2023-05-30 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6219b7c61a94: [clang-tidy] Do not emit bugprone-exception-escape warnings from coroutines (authored by denizevrenci, committed by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D143851: [clang-tidy] Tweak 'rule of 3/5' checks to allow defaulting a destructor outside the class.

2023-02-14 Thread Piotr Zegar via Phabricator via cfe-commits
ClockMan added a comment. Thing is that same issue may happen with all other members, what about copy/move constructors defaulted in .cpp (just to speed up compilation for classes with many members). Best thing would simply to check if all definitions are available. In that case issues would be

[PATCH] D143851: [clang-tidy] Tweak 'rule of 3/5' checks to allow defaulting a destructor outside the class.

2023-02-14 Thread Piotr Zegar via Phabricator via cfe-commits
ClockMan added a comment. In D143851#4126615 , @carlosgalvezp wrote: > Yes, clang-tidy will not issue warnings in system headers, so checks should > not need to explicitly handle that. That's not so simple. At work we use clang-tidy for few big project

[PATCH] D144037: [clang-tidy] allow tests to use -config-file instead of -config

2023-02-14 Thread Piotr Zegar via Phabricator via cfe-commits
ClockMan added inline comments. Comment at: clang-tools-extra/test/clang-tidy/check_clang_tidy.py:111 if not any( -[arg.startswith('-config=') for arg in self.clang_tidy_extra_args]): +[arg.startswith('-config=') or arg.startswith('-config-file=') for arg in

[PATCH] D144036: [clang-tidy] Add bugprone-enum-to-bool-conversion check

2023-02-15 Thread Piotr Zegar via Phabricator via cfe-commits
ClockMan created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. ClockMan updated this revision to Diff 497408. ClockMan added a comment. Eugene.Zelenko added reviewers: aaron.ballman, carlosgalvezp. ClockMan updated

[PATCH] D144036: [clang-tidy] Add bugprone-enum-to-bool-conversion check

2023-02-15 Thread Piotr Zegar via Phabricator via cfe-commits
ClockMan updated this revision to Diff 497727. ClockMan marked 3 inline comments as done. ClockMan added a comment. Corrected issues mentioned in review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144036/new/ https://reviews.llvm.org/D144036 Fil

[PATCH] D144036: [clang-tidy] Add bugprone-enum-to-bool-conversion check

2023-02-15 Thread Piotr Zegar via Phabricator via cfe-commits
ClockMan added a comment. Fixed Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144036/new/ https://reviews.llvm.org/D144036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D144135: [clang-tidy] Add performance-enum-size check

2023-02-15 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. PiotrZSL updated this revision to Diff 497787. PiotrZSL added a comment. PiotrZSL updated this revision to Diff 497804. PiotrZSL updated this revision

[PATCH] D144206: [clang-tidy] Fix false-positive in cppcoreguidelines-slicing

2023-02-16 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added subscribers: carlosgalvezp, shchenz, kbarton, xazax.hun, nemanjai. Herald added a reviewer: njames93. Herald added a project: All. PiotrZSL published this revision for review. PiotrZSL added a comment. Herald added a project: clang-tools-extra. Herald ad

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-17 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. I run this check on project that I work for, here my comments: False-positives (for me) std::optional&& obj + std::move(opj.value()); std::pair&& obj+ std::forward>(obj); Type1&& factory + factory.create() [on initialization list] (create is not && method) Type

[PATCH] D144135: [clang-tidy] Add performance-enum-size check

2023-02-17 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 498471. PiotrZSL added a comment. Updated documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144135/new/ https://reviews.llvm.org/D144135 Files: clang-tools-extra/clang-tidy/performance/CMakeLists

[PATCH] D144135: [clang-tidy] Add performance-enum-size check

2023-02-17 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 498472. PiotrZSL added a comment. Typo in doc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144135/new/ https://reviews.llvm.org/D144135 Files: clang-tools-extra/clang-tidy/performance/CMakeLists.txt clan

[PATCH] D144217: [clang-tidy] Fix false-positive in readability-container-size-empty

2023-02-17 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. PiotrZSL added a comment. Eugene.Zelenko added reviewers: aaron.ballman, carlosgalvezp. PiotrZSL updated this revision to Diff 498450. PiotrZSL publish

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-17 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. You right swap case can also be invalid (rvalue not needed, there). Anyway it it has too be script then this can be strict. But message could be better, for example if we don't move all fields of class, then this could warn that its not fully moved, or that some members

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-18 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. In D141569#4136493 , @ccotter wrote: > @PiotrZSL I added an option to allow disabling the strict behavior. It should > address many of your examples (e.g., moving subobjects) . Let me know if you > have more feedback. I will r

[PATCH] D144347: [clang-tidy] Add readability-forward-usage check

2023-02-19 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. PiotrZSL updated this revision to Diff 498666. PiotrZSL added a comment. Eugene.Zelenko added reviewers: aaron.ballman, carlosgalvezp. PiotrZSL marked

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. I don't know why but with latest version I still got false positive with std::function on Clang 15. using Functor= std::function<... something ...>; std::unique_ptr Class::createSomething(::Functor&& functor) { return std::make_unique(std::move(functor));

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Other false-positive that I still see: void SomeClass::someVirtualFunction(SomeType&&) { BOOST_THROW_EXCEPTION(std::runtime_error("Unexpected call ")); } It shouldnt warn about virtual functions with unnamed parameter, because this can be required by interf

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. And on something like this I still got reproduction in production code: template struct SomeClass { public: explicit SomeClass(T&& value) : value(std::forward(value)) {} T value; }; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/rvalue-reference-param-not-moved.cpp:301 + } + void never_moves(T&& t) {} + // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: rvalue reference parameter 't' is never moved fro

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. In D141569#4139290 , @ccotter wrote: > In > > template > struct SomeClass > { > public: > explicit SomeClass(T&& value) : value(std::forward(value)) {} >T value; > }; > > `T` is not a universal reference in the

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. In D141569#4139320 , @ccotter wrote: > I was split on handling the case where the parameter that was never moved > from was not named. For this guideline enforcement to flag all unmoved rvalue > reference parameters, code that

[PATCH] D144037: [clang-tidy] allow tests to use --config-file instead of --config

2023-02-20 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG38b1a17c519d: [clang-tidy] allow tests to use --config-file instead of --config (authored by amurzeau, committed by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://re

[PATCH] D144041: [clang-tidy] add primitive types for hungarian identifier-naming (unsigned char and void)

2023-02-20 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG37e6a4f9496c: [clang-tidy] add primitive types for hungarian identifier-naming (unsigned char… (authored by amurzeau, committed by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D144429: [clang-tidy] Add bugprone-chained-comparison check

2023-02-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. PiotrZSL added a comment. PiotrZSL published this revision for review. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commit

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-21 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp:22-24 + parmVarDecl(hasType(type(rValueReferenceType(.bind("param"), + parmVarDecl( + equalsBoundNode("param"), ---

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-21 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp:21 + Finder->addMatcher( + parmVarDecl(allOf( + parmVarDecl(hasType(type(rValueReferenceType(.bind("param"), and y

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-21 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp:26-29 + unless(hasType(qualType(references(templateTypeParmType( + hasDeclaration(templateTypeParmDecl())), +

[PATCH] D144217: [clang-tidy] Fix false-positive in readability-container-size-empty

2023-02-21 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. In D144217#4143540 , @carlosgalvezp wrote: >> Perhaps, this can even be generalized to all types whose size() and empty() >> are constexpr. Problem is that you can mark function constexpr, but it doesnt need to be constexpr e

[PATCH] D144217: [clang-tidy] Fix false-positive in readability-container-size-empty

2023-02-22 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp:101 + IgnoreComparisonForTypesRegexp( + Options.get("IgnoreComparisonForTypesRegexp", "^::std::array")) {} + carlosgalvezp wrote: > I a

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-22 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Overall not bad, except reported things, I don't have any complains. Number of options is not an issue. 90% of users wont use them, 10% will be happy to find them instead of dealing with NOLINT. Comment at: clang-tools-extra/clang-tidy/cppcoreguideli

[PATCH] D144217: [clang-tidy] Fix false-positive in readability-container-size-empty

2023-02-22 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 499642. PiotrZSL added a comment. Review fixes + Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144217/new/ https://reviews.llvm.org/D144217 Files: clang-tools-extra/clang-tidy/readability/ContainerSi

[PATCH] D144217: [clang-tidy] Fix false-positive in readability-container-size-empty

2023-02-22 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 499643. PiotrZSL added a comment. Removed include Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144217/new/ https://reviews.llvm.org/D144217 Files: clang-tools-extra/clang-tidy/readability/ContainerSizeEmpt

[PATCH] D144594: [clang-tidy] Fix bugprone-copy-constructor-init documentation

2023-02-22 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added a subscriber: xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. PiotrZSL requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Correct example, and add information

[PATCH] D144522: [clang-tidy] Add readability-operators-representation check

2023-02-22 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. PiotrZSL added a comment. PiotrZSL updated this revision to Diff 499306. Eugene.Zelenko added reviewers: aaron.ballman, carlosgalvezp. PiotrZSL marked

[PATCH] D144594: [clang-tidy] Fix bugprone-copy-constructor-init documentation

2023-02-22 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 499732. PiotrZSL added a comment. Update doc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144594/new/ https://reviews.llvm.org/D144594 Files: clang-tools-extra/docs/clang-tidy/checks/bugprone/copy-construc

[PATCH] D144594: [clang-tidy] Fix bugprone-copy-constructor-init documentation

2023-02-22 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 499733. PiotrZSL added a comment. Update doc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144594/new/ https://reviews.llvm.org/D144594 Files: clang-tools-extra/docs/clang-tidy/checks/bugprone/copy-construc

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. One more thing I noticed, this check can be in conflict with performance-move-const-arg. warning: std::move of the variable 'xyz' of the trivially-copyable type 'types::xyz' has no effect; remove std::move() [performance-move-const-arg] so would be nice to make sure

[PATCH] D141569: [clang-tidy] Implement CppCoreGuideline F.18

2023-02-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. In D141569#4147268 , @ccotter wrote: > Trivial types should not be passed by rvalue reference, but by value per the > diagram under > http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#fcall-parameter-passing. > I fee

[PATCH] D144217: [clang-tidy] Fix false-positive in readability-container-size-empty

2023-02-24 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 500232. PiotrZSL added a comment. Rebase + Used existing matcher instead of creating new one Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144217/new/ https://reviews.llvm.org/D144217 Files: clang-tools-ext

[PATCH] D144748: [clang-tidy] Add bugprone-empty-catch check

2023-02-24 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. PiotrZSL requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Detects and suggests ad

[PATCH] D149899: [clang-tidy] Support SystemHeaders in .clang-tidy

2023-05-05 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. This revision is now accepted and ready to land. From functionally point of view, LGTM. Comment at: clang-tools-extra/test/clang-tidy/infrastructure/system-headers.cpp:11 +// RUN: clang-tidy -checks='-*,google-explicit

[PATCH] D149899: [clang-tidy] Support SystemHeaders in .clang-tidy

2023-05-05 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/test/clang-tidy/infrastructure/system-headers.cpp:11 +// RUN: clang-tidy -checks='-*,google-explicit-constructor' -header-filter='.*' -config='SystemHeaders: false' %s -- -isystem %S/Inputs/system-headers 2>&1 | Fil

[PATCH] D149723: [clang-tidy] Optimize performance of RenamerClangTidyCheck

2023-05-05 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL marked 3 inline comments as done. PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp:47 -std::hash SecondHash; -return DenseMapInfo::getHashValue(Val.first) + - SecondHash(Val.second); +return

[PATCH] D149723: [clang-tidy] Optimize performance of RenamerClangTidyCheck

2023-05-05 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 519924. PiotrZSL marked 3 inline comments as done. PiotrZSL added a comment. Use operator + instead of hash_combine. Use TraverseAST. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149723/new/ https://reviews.

[PATCH] D149518: [clang][NFC] Optimize clang::ASTNodeKind::isBaseOf

2023-05-05 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 520031. PiotrZSL added a comment. Rebase without changes, just because some testcase in this baseline looks to fail. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149518/new/ https://reviews.llvm.org/D149518

[PATCH] D146921: [clang-tidy] Implement cppcoreguidelines F.19

2023-05-05 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. `forwarding reference parameter '' is never forwarded inside the function body [cppcoreguidelines-missing-std-forward]` consider ignoring unnamed parameters, they unused, so nothing to forward. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://

[PATCH] D146921: [clang-tidy] Implement cppcoreguidelines F.19

2023-05-06 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 520043. PiotrZSL added a comment. Add delayed template parsing in tests (to fix windows tests) Reorder release notes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146921/new/ https://reviews.llvm.org/D146921

[PATCH] D146921: [clang-tidy] Implement cppcoreguidelines F.19

2023-05-06 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5902bb9584d6: [clang-tidy] Implement cppcoreguidelines F.19 (authored by ccotter, committed by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D14692

[PATCH] D149518: [clang][NFC] Optimize clang::ASTNodeKind::isBaseOf

2023-05-06 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc3d16514d061: [clang][NFC] Optimize clang::ASTNodeKind::isBaseOf (authored by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D149723: [clang-tidy] Optimize performance of RenamerClangTidyCheck

2023-05-06 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1c282052624f: [clang-tidy] Optimize performance of RenamerClangTidyCheck (authored by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149723/new/ h

[PATCH] D148458: [clang-tidy][NFC] Split bugprone-exception-escape tests

2023-05-07 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5545f1bbd4e1: [clang-tidy][NFC] Split bugprone-exception-escape tests (authored by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148458/new/ http

[PATCH] D150187: [tidy][IdentifierNaming] Fix crashes on non-identifiers

2023-05-09 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. This revision is now accepted and ready to land. LGTM, fell free to deliver (to quickly fix crash). Any improvements could be done later. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp:457 + /

[PATCH] D150187: [tidy][IdentifierNaming] Fix crashes on non-identifiers

2023-05-09 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-nocrash.cpp:3-5 +struct Foo { + operator bool(); +}; PiotrZSL wrote: > i would merge this with some existing test file... yep, tests fails due t

[PATCH] D148995: [clang-tidy] Extract areStatementsIdentical

2023-05-15 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6ccb8061724f: [clang-tidy] Extract areStatementsIdentical (authored by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148995/new/ https://reviews.

[PATCH] D150761: [NFC][Py Reformat] Reformat python files in clang and clang-tools-extra

2023-05-19 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Checked clang-tidy scripts, looks +- fine. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150761/new/ https://reviews.llvm.org/D150761 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D148697: [clang-tidy] Handle more cases of functions which should always be noexcept

2023-04-19 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Few issues, first we should have single check for a single cppcoreguidelines rule. And due to that I'm not fan of merging these things, because for example If I would enable this check in my project I woudn't like to enforce noexcept default constructor or destructor.

[PATCH] D148318: [clang-tidy] Add `performance-avoid-endl` check

2023-04-19 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Overall looks good, didn't found any bugs, just some potential improvements. Comment at: clang-tools-extra/clang-tidy/performance/AvoidEndlCheck.cpp:23 +void AvoidEndlCheck::registerMatchers(MatchFinder *Finder) { + Finder->addMatcher( + expr(unl

[PATCH] D148318: [clang-tidy] Add `performance-avoid-endl` check

2023-04-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. This revision is now accepted and ready to land. More or less looks good. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148318/new/ https://reviews.llvm.org/D148318 ___

[PATCH] D147357: [clang-tidy] Add bugprone-optional-value-conversion check

2023-04-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL marked 2 inline comments as done. PiotrZSL added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/optional-value-conversion.cpp:16 + }; +} + njames93 wrote: > PiotrZSL wrote: > > njames93 wrote: > > > It'd be good to hav

[PATCH] D147357: [clang-tidy] Add bugprone-optional-value-conversion check

2023-04-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 515475. PiotrZSL marked an inline comment as done. PiotrZSL added a comment. Added support for ->, added more tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147357/new/ https://reviews.llvm.org/D147357

[PATCH] D147357: [clang-tidy] Add bugprone-optional-value-conversion check

2023-04-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Ready for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147357/new/ https://reviews.llvm.org/D147357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[PATCH] D147357: [clang-tidy] Add bugprone-optional-value-conversion check

2023-04-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 515476. PiotrZSL added a comment. Marked check as one that provides fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147357/new/ https://reviews.llvm.org/D147357 Files: clang-tools-extra/clang-tidy/bugp

[PATCH] D148462: [clang-tidy] Ignore declarations in bugprone-exception-escape

2023-04-20 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. @njames93 What do you thing ? Should bugprone-exception-escape provide warnings for all forward declarations and definition, or only for definition. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148462/new/ https://review

[PATCH] D148318: [clang-tidy] Add `performance-avoid-endl` check

2023-04-22 Thread Piotr Zegar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcd893308b5d4: [clang-tidy] Add `performance-avoid-endl` check (authored by AMS21, committed by PiotrZSL). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D14831

[PATCH] D148995: [clang-tidy] Extract areStatementsIdentical

2023-04-22 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. PiotrZSL added reviewers: njames93, carlosgalvezp. Herald added a subscriber: xazax.hun. Herald added a project: All. PiotrZSL requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Move areStatementsIde

[PATCH] D149015: [clang-tidy] Added bugprone-inc-dec-in-conditions check

2023-04-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. PiotrZSL added reviewers: njames93, carlosgalvezp. Herald added a subscriber: xazax.hun. Herald added a project: All. PiotrZSL requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Detects when a variab

[PATCH] D148458: [clang-tidy][NFC] Split bugprone-exception-escape tests

2023-04-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 516139. PiotrZSL marked 2 inline comments as done. PiotrZSL added a comment. Formating fixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148458/new/ https://reviews.llvm.org/D148458 Files: clang-tools-ext

[PATCH] D148458: [clang-tidy][NFC] Split bugprone-exception-escape tests

2023-04-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-throw.cpp:4 +void throwing_throw_nothing() throw() { +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in function 'throwing_throw_nothing' whi

[PATCH] D149015: [clang-tidy] Added bugprone-inc-dec-in-conditions check

2023-04-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 516140. PiotrZSL added a comment. Undo change for cppcoreguidelines-use-default-member-init Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149015/new/ https://reviews.llvm.org/D149015 Files: clang-tools-extr

[PATCH] D148995: [clang-tidy] Extract areStatementsIdentical

2023-04-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Thank you for your feedback regarding the code review. I understand that the review includes the removal of 35 lines and the addition of 42 lines. However, I would like to point out that the areStatementsIdentical function and the other function in question are only ar

[PATCH] D145581: [clang-tidy] In C++17, callee is guaranteed to be sequenced before arguments.

2023-04-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. First, re-base code, looks like there were some changes in this check, and now there are conflicts with this path. Second I don't any more comments, for me this code looks fine, BUT I'm not familiar too much with this check. Check history for this check, and maybe consi

[PATCH] D148461: [clang-tidy] Support C++17/20 in bugprone-exception-escape

2023-04-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL planned changes to this revision. PiotrZSL added a comment. TODO: Fix function pointer compare Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148461/new/ https://reviews.llvm.org/D148461 ___ cfe-

[PATCH] D148110: [clang-tidy] Ctor arguments are sequenced if ctor call is written as list-initialization.

2023-04-23 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Tests in lines 1195, 1201 actually tests InitListExpr. Test in line 1207 test negative scenario of CXXConstructExpr (list), but I didn't found any positive test for CXXConstructExpr with list expr, please add such test to show that warnings are still produced for such c

[PATCH] D148110: [clang-tidy] bugprone-use-after-move: Ctor arguments should be sequenced if ctor call is written as list-initialization.

2023-04-24 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:216-219 - Improved :doc:`bugprone-use-after-move - ` check to also cover constructor - initializers. + ` check: Also cover constructor + initializers. Fix check to understand that constructor

[PATCH] D149084: [clang-tidy] Added bugprone-multi-level-implicit-pointer-conversion check

2023-04-24 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. PiotrZSL requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Detects implicit conver

[PATCH] D148458: [clang-tidy][NFC] Split bugprone-exception-escape tests

2023-04-24 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL updated this revision to Diff 516481. PiotrZSL marked an inline comment as done. PiotrZSL added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148458/new/ https://reviews.llvm.org/D148458 Files: clang-tools-extra/test/c

[PATCH] D148110: [clang-tidy] bugprone-use-after-move: Ctor arguments should be sequenced if ctor call is written as list-initialization.

2023-04-26 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL accepted this revision. PiotrZSL added a comment. This revision is now accepted and ready to land. +- LGTM Comment at: clang-tools-extra/docs/ReleaseNotes.rst:217 - Improved :doc:`bugprone-use-after-move - ` check to also cover constructor - initializers. + ` check

[PATCH] D147875: [clang][Diagnostics] Show line numbers when printing code snippets

2023-04-26 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. In D147875#4283135 , @tbaeder wrote: > CCing @njames93 since I have no idea how to properly fix the clang-tidy test > failures. I look into some of those tests, there are 1 way to fix them. Tried to `-fno-diagnostics-show-line

[PATCH] D147875: [clang][Diagnostics] Show line numbers when printing code snippets

2023-04-27 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp:34 // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}L{{$}} // CHECK-FIXES: static conste

[PATCH] D149280: [clang-tidy] Add modernize-printf-to-std-print check

2023-04-27 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/PrintfToStdPrintCheck.cpp:28 + ReplacementPrintFunction(Options.get("PrintFunction", "std::print")) { + PrintfLikeFunctions.push_back("printf"); + PrintfLikeFunctions.push_back("absl::PrintF

[PATCH] D149518: [clang] Optimize clang::ASTNodeKind::isBaseOf

2023-04-29 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL created this revision. Herald added subscribers: luismarques, s.egerton, PkmX, simoncook, arichardson. Herald added a project: All. PiotrZSL requested review of this revision. Herald added subscribers: cfe-commits, pcwang-thead. Herald added a project: clang. Create dedicated isBaseOf met

[PATCH] D149518: [clang] Optimize clang::ASTNodeKind::isBaseOf

2023-04-29 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Lookup matrix gives best result (~-80%), bu it consume lot of memory due to big amount of enumerators (~950). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149518/new/ https://reviews.llvm.org/D149518 ___

<    3   4   5   6   7   8   9   >