[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-06-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,83 @@ +.. title:: clang-tidy - bugprone-exception-rethrow + +bugprone-exception-rethrow +== + +Identifies problematic exception rethrowing, especially with caught exception +variables or empty throw statements outside catch blocks. + +In C++ exce

[clang-tools-extra] [clang-tidy] Added bugprone-exception-rethrow check (PR #86448)

2024-06-09 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,83 @@ +.. title:: clang-tidy - bugprone-exception-rethrow + +bugprone-exception-rethrow +== + +Identifies problematic exception rethrowing, especially with caught exception +variables or empty throw statements outside catch blocks. + +In C++ exce

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() (PR #90043)

2024-06-10 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Yes, you can just submit new PR, reference this one. https://github.com/llvm/llvm-project/pull/90043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix false positives for the functions with the same name as standard library functions in misc-include-cleaner (PR #94923)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/94923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add WarnOnSizeOfPointer mode to bugprone-sizeof-expression (PR #94356)

2024-06-10 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/94356 ___ cfe-commits mai

[clang-tools-extra] [clang-tidy] Add WarnOnSizeOfPointer mode to bugprone-sizeof-expression (PR #94356)

2024-06-10 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: https://github.com/PiotrZSL approved this pull request. Overall LGTM. It doesn't look to break (by default) previous beha

[clang-tools-extra] [clang-tidy] Add WarnOnSizeOfPointer mode to bugprone-sizeof-expression (PR #94356)

2024-06-10 Thread Piotr Zegar via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -292,11 +318,17 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { diag(E->getBeginLoc(),

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/93827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] fix(clang-tools-extra/**.py): fix comparison to None (PR #94013)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/94013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] fix(clang-tools-extra/**.py): fix comparison to None (PR #94013)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/94013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] fix(clang-tools-extra/**.py): fix invalid escape sequences (PR #94028)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM, I will merge this once I confirm that it still works. https://github.com/llvm/llvm-project/pull/94028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang-tools-extra] fix(clang-tools-extra/**.py): fix invalid escape sequences (PR #94028)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/94028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] bc70c29 - [clang-tidy][DOC] Update doc for Clang Static Analyzer checks

2024-06-10 Thread Piotr Zegar via cfe-commits
Author: Piotr Zegar Date: 2024-06-10T19:07:49Z New Revision: bc70c29558c6ecb53e61cc8d668768e919e81bde URL: https://github.com/llvm/llvm-project/commit/bc70c29558c6ecb53e61cc8d668768e919e81bde DIFF: https://github.com/llvm/llvm-project/commit/bc70c29558c6ecb53e61cc8d668768e919e81bde.diff LOG: [

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Few nits: - storeOptions needs fix - Consider excluding implicit code with TK_IgnoreUnlessSpelledInSource (not this may exclude also template instances, so I leave it up to you) - Documentation require small work - Make check mo

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/91951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,61 @@ +.. title:: clang-tidy - bugprone-pointer-arithmetic-on-polymorphic-object + +bugprone-pointer-arithmetic-on-polymorphic-object += + +Finds pointer arithmetic performed on classes that declare a virtual function. + +

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,61 @@ +.. title:: clang-tidy - bugprone-pointer-arithmetic-on-polymorphic-object + +bugprone-pointer-arithmetic-on-polymorphic-object += + +Finds pointer arithmetic performed on classes that declare a virtual function. + +

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.cpp - clang-tidy===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.cpp - clang-tidy===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -126,6 +126,11 @@ New checks reference. This may cause use-after-free errors if the caller uses xvalues as arguments. +- New :doc:`bugprone-pointer-arithmetic-on-polymorphic-object + ` check. + + Finds pointer arithmetic performed on classes that declare a virtual fu

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.cpp - clang-tidy===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,49 @@ +//===--- VirtualArithmeticCheck.cpp - clang-tidy---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.cpp - clang-tidy===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,38 @@ +//===--- PointerArithmeticOnPolymorphicObjectCheck.h *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,61 @@ +.. title:: clang-tidy - bugprone-pointer-arithmetic-on-polymorphic-object + +bugprone-pointer-arithmetic-on-polymorphic-object += + +Finds pointer arithmetic performed on classes that declare a virtual function. + +

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,61 @@ +.. title:: clang-tidy - bugprone-pointer-arithmetic-on-polymorphic-object + +bugprone-pointer-arithmetic-on-polymorphic-object += + +Finds pointer arithmetic performed on classes that declare a virtual function. + +

[clang-tools-extra] [clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` check (PR #91951)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -126,6 +126,11 @@ New checks reference. This may cause use-after-free errors if the caller uses xvalues as arguments. +- New :doc:`bugprone-pointer-arithmetic-on-polymorphic-object PiotrZSL wrote: add in line 173 info about new alias (check release not

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-06-10 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: @BenBlaise Clang-tidy 19 branch out is in ... a month. Any plans to finish this ? It's fine if this would get in limited scope (only for explicit casts), but some current issues need fixes. https://github.com/llvm/llvm-project/pull/76065

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/67467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-06-10 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. @pizzud To be honest I see this check being already done in 99%. Please resolve some last nits, rebase code and we could merge it in this month. https://github.com/llvm/llvm-project/pull/67467 ___

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,19 @@ +.. title:: clang-tidy - bugprone-move-shared-pointer-contents + +bugprone-move-shared-pointer-contents += + + +Detects calls to move the contents out of a ``std::shared_ptr`` rather +than moving the pointer itself. In other wor

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -368,8 +374,7 @@ Changes in existing checks ` check to avoid false positive when using pointer to member function. Additionally, the check no longer emits a diagnostic when a variable that is not type-dependent is an operand of a - type-dependent binary operator. Imp

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,145 @@ +//===--- MoveSharedPointerContentsCheck.cpp - clang-tidy --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -383,7 +388,7 @@ Changes in existing checks - Improved :doc:`misc-unused-using-decls ` check to avoid false positive when - using in elaborated type and only check cpp files. PiotrZSL wrote: revert this small change. https://github.com/llvm/llvm-proje

[clang-tools-extra] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2024-06-10 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,145 @@ +//===--- MoveSharedPointerContentsCheck.cpp - clang-tidy --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] ignoring macro with hash preprocessing token in cppcoreguidelines-macro-usage (PR #95265)

2024-06-12 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/95265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] In C++17, callee is guaranteed to be sequenced before arguments. (PR #93623)

2024-06-13 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/93623 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/95434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Few nits. https://github.com/llvm/llvm-project/pull/95434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-14 Thread Piotr Zegar via cfe-commits
@@ -18,20 +17,87 @@ namespace clang::tidy::bugprone { void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( returnStmt( - hasReturnValue(declRefExpr(to(parmVarDecl(hasType(hasCanonicalType( - qualType(ma

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-14 Thread Piotr Zegar via cfe-commits
@@ -18,20 +17,87 @@ namespace clang::tidy::bugprone { void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( returnStmt( - hasReturnValue(declRefExpr(to(parmVarDecl(hasType(hasCanonicalType( - qualType(ma

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Consider replacing ":" separator with "," https://github.com/llvm/llvm-project/pull/95550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy]fix false positives of the result of std::move() is used as rvalue for performance-move-const-arg (PR #95633)

2024-06-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/95633 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix false negatives for performance-inefficient-vector-operation (PR #95667)

2024-06-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/95667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-18 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Main reason why I pointed out that I do not like ':' character and would prefer ',' or ';' is that: - no other check is using it - could in theory cause an issue for some tools that parse warnings because ': ' characters are after "warning" and basically almost never happen in m

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/96122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-20 Thread Piotr Zegar via cfe-commits
@@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList`

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-20 Thread Piotr Zegar via cfe-commits
@@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList`

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-20 Thread Piotr Zegar via cfe-commits
@@ -125,6 +125,9 @@ Improvements to clang-tidy - Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` to exclude headers from analysis via a RegEx. +- Added argument `--allow-empty-checks` and config option `AllowEmptyCheckList`

[clang-tools-extra] [clang-tidy] add option to avoid "no checks enabled" error (PR #96122)

2024-06-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. if a reason for this parameter is not to fail wrapper scripts, then maybe run-clang-tidy.py / run-clang-tidy-diff.py should also be updated. https://github.com/llvm/llvm-project/pull/96122

[clang-tools-extra] [clang-tidy] Fix handling of members in readability-redundant-member-init (PR #93217)

2024-05-28 Thread Piotr Zegar via cfe-commits
@@ -387,6 +387,11 @@ Changes in existing checks ` check to properly emit warnings for static data member with an in-class initializer. +- Improved :doc:`readability-redundant-member-init + ` check to avoid + false-positives when type of the member does not match type of

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-05-28 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] Optimize realpath in readability-identifier-naming (PR #92659)

2024-05-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/92659 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Update identifier-length.rst (PR #93467)

2024-05-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/93467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix handling of members in readability-redundant-member-init (PR #93217)

2024-05-28 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/93217 >From 14e3f91ba749eec5be94a9cad370f794ad836fc8 Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Wed, 22 May 2024 20:56:00 + Subject: [PATCH 1/2] [clang-tidy] Fix handling of members in readability-redundant

[clang-tools-extra] [clang-tidy] Check number of arguments to size/length in readability-container-size-empty (PR #93724)

2024-05-29 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL created https://github.com/llvm/llvm-project/pull/93724 Verify that size/length methods are called with no arguments. Closes #88203 >From 0e8c1ceb616d797298db720069e2eea937a9078e Mon Sep 17 00:00:00 2001 From: Piotr Zegar Date: Wed, 29 May 2024 19:39:22 + Subje

[clang-tools-extra] [clang-tidy] Check number of arguments to size/length in readability-container-size-empty (PR #93724)

2024-05-29 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: I'm not 100% sure about release-notes entry. If it shouldn't say that check is restricted now to zero-argument size/length. https://github.com/llvm/llvm-project/pull/93724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang-tools-extra] [clang-tidy] Check number of arguments to size/length in readability-container-size-empty (PR #93724)

2024-05-30 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/93724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-30 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. - storeOptions is missing - release notes need to be updated about added new option - tests need some love (reduce amount of changes) - what about "static" non const global variables I'm fine for having an options that control

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-30 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/93827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-30 Thread Piotr Zegar via cfe-commits
@@ -16,9 +15,12 @@ using namespace clang::ast_matchers; namespace clang::tidy::cppcoreguidelines { void AvoidNonConstGlobalVariablesCheck::registerMatchers(MatchFinder *Finder) { + auto NamespaceMatcher = Options.get("AllowAnonymousNamespace", false) PiotrZSL

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-30 Thread Piotr Zegar via cfe-commits
@@ -1,29 +1,39 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-avoid-non-const-global-variables %t +// RUN: %check_clang_tidy %s -check-suffix=DEFAULT cppcoreguidelines-avoid-non-const-global-variables %t +// RUN: %check_clang_tidy %s -check-suffix=NAMESPACE cppcoreguideline

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-30 Thread Piotr Zegar via cfe-commits
@@ -41,3 +41,25 @@ The variables ``a``, ``c``, ``c_ptr1``, ``c_const_ptr`` and ``c_reference`` will all generate warnings since they are either a non-const globally accessible variable, a pointer or a reference providing global access to non-const data or both. + +Options +--

[clang-tools-extra] [clang-tidy] Option to ignore anonymous namespaces in avoid-non-const-global-variables (PR #93827)

2024-05-30 Thread Piotr Zegar via cfe-commits
@@ -41,3 +41,25 @@ The variables ``a``, ``c``, ``c_ptr1``, ``c_const_ptr`` and ``c_reference`` will all generate warnings since they are either a non-const globally accessible variable, a pointer or a reference providing global access to non-const data or both. + +Options +--

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-01 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/94104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-01 Thread Piotr Zegar via cfe-commits
@@ -20,6 +20,11 @@ namespace clang::tidy::modernize { namespace { AST_MATCHER(StringLiteral, isOrdinary) { return Node.isOrdinary(); } +AST_MATCHER(QualType, isSimpleChar) { + const auto ActualType = Node.getTypePtr(); + return ActualType->isSpecificBuiltinType(BuiltinType::

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-01 Thread Piotr Zegar via cfe-commits
@@ -20,6 +20,11 @@ namespace clang::tidy::modernize { namespace { AST_MATCHER(StringLiteral, isOrdinary) { return Node.isOrdinary(); } +AST_MATCHER(QualType, isSimpleChar) { + const auto ActualType = Node.getTypePtr(); + return ActualType->isSpecificBuiltinType(BuiltinType::

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-01 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. Overall LGTM, consider adding release note entry for modernize-use-std-print (as it were added in previous release) https://github.com/llvm/llvm-project/pull/94104 ___ cfe-commits mailing list cf

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Piotr Zegar via cfe-commits
@@ -351,6 +351,10 @@ Changes in existing checks ` check to also handle calls to ``compare`` method. +- Improved :doc:`modernize-use-std-format` and PiotrZSL wrote: remove modernize-use-std-format from here, as it's new check, only leave std-print https:

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/94104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/94104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-06-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-06-04 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,78 @@ +//===--- UseInternalLinkageCheck.cpp - clang-tidy--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang-tidy] new check misc-use-internal-linkage (PR #90830)

2024-06-04 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. I accept this change as it's fine for 1.0 version Any fixed can be always done in this or new change. https://github.com/llvm/llvm-project/pull/90830 ___ cfe-commits mailing list cfe-commits@lists

[clang-tools-extra] [clang-tidy][NFC] Fix `linuxkernel-must-check-errs` documentation file name (PR #88655)

2024-04-15 Thread Piotr Zegar via cfe-commits
@@ -299,6 +299,10 @@ Miscellaneous ``--format`` option is specified. Now :program:`clang-apply-replacements` applies formatting only with the option. +- Fixed the :doc:`linuxkernel-must-check-errs + ` documentation to consistently + use the check's proper name.

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-15 Thread Piotr Zegar via cfe-commits
@@ -102,6 +102,7 @@ Improvements to clang-tidy similar fashion to what `-header-filter` does for header files. - Improved :program:`check_clang_tidy.py` script. Added argument `-export-fixes` to aid in clang-tidy and test development. +- Fixed an issue with `bugprone-forwa

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-15 Thread Piotr Zegar via cfe-commits
@@ -287,6 +286,10 @@ Changes in existing checks check by resolving fix-it overlaps in template code by disregarding implicit instances. +- Improved :doc:`bugprone-forwarding-reference-overload PiotrZSL wrote: move it to line 149, to keep checks in alphabe

[clang-tools-extra] [clang-tidy] Refactor how NamedDecl are renamed (PR #88735)

2024-04-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. For me looks fine. Give it few days before merging, so others would have opportunity to review. https://github.com/llvm/llvm-project/pull/88735 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang-tools-extra] [clang-tidy] Refactor how NamedDecl are renamed (PR #88735)

2024-04-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/88735 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Refactor how NamedDecl are renamed (PR #88735)

2024-04-15 Thread Piotr Zegar via cfe-commits
@@ -61,6 +61,44 @@ struct DenseMapInfo { namespace clang::tidy { namespace { +/// Returns the function that \p Method is overridding. If There are none or +/// multiple overrides it returns nullptr. If the overridden function itself is +/// overridding then it will recurse up

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/88138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Revert "[clang analysis] ExprMutationAnalyzer avoid infinite recursion for recursive forwarding reference" (PR #88765)

2024-04-15 Thread Piotr Zegar via cfe-commits
PiotrZSL wrote: Looks like cyclic-dependency between shared_ptrs... Thx. https://github.com/llvm/llvm-project/pull/88765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang analysis] ExprMutationAnalyzer support recursive forwarding reference (PR #88843)

2024-04-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/88843 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy NFC] Fix a typo in docs for sizeof-expression (PR #88912)

2024-04-16 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/88912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] Add new check `modernize-use-designated-initializers` (PR #80541)

2024-04-16 Thread Piotr Zegar via cfe-commits
Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8?q?Mösch?= , Danny =?utf-8

[clang-tools-extra] [clang-tidy] bugprone-lambda-function-name ignore macro in captures (PR #89076)

2024-04-17 Thread Piotr Zegar via cfe-commits
@@ -69,9 +71,8 @@ void LambdaFunctionNameCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { } void LambdaFunctionNameCheck::registerMatchers(MatchFinder *Finder) { - // Match on PredefinedExprs inside a lambda. - Finder->addMatcher(predefinedExpr(hasAncestor(lambdaExp

[clang-tools-extra] [clang-tidy] bugprone-lambda-function-name ignore macro in captures (PR #89076)

2024-04-18 Thread Piotr Zegar via cfe-commits
@@ -69,9 +73,13 @@ void LambdaFunctionNameCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { } void LambdaFunctionNameCheck::registerMatchers(MatchFinder *Finder) { - // Match on PredefinedExprs inside a lambda. - Finder->addMatcher(predefinedExpr(hasAncestor(lambdaEx

[clang-tools-extra] [clang-tidy] fix add_new_check.py regex (PR #89189)

2024-04-18 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. https://github.com/llvm/llvm-project/pull/89189 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] bugprone-lambda-function-name ignore macro in captures (PR #89076)

2024-04-18 Thread Piotr Zegar via cfe-commits
@@ -69,9 +73,13 @@ void LambdaFunctionNameCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { } void LambdaFunctionNameCheck::registerMatchers(MatchFinder *Finder) { - // Match on PredefinedExprs inside a lambda. - Finder->addMatcher(predefinedExpr(hasAncestor(lambdaEx

[clang-tools-extra] [clang-tidy] bugprone-lambda-function-name ignore macro in captures (PR #89076)

2024-04-18 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/89076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [run-clang-tidy.py] Add -directory-filter option to run-clang-tidy.py (PR #89302)

2024-04-19 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/89302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [run-clang-tidy.py] Add -directory-filter option to run-clang-tidy.py (PR #89302)

2024-04-19 Thread Piotr Zegar via cfe-commits
@@ -307,6 +307,14 @@ def main(): "source files from compilation database to output " "diagnostics from.", ) +parser.add_argument( +"-directory-filter", +dest="directory_filter", +action="append", +default=[], +help

[clang-tools-extra] [run-clang-tidy.py] Add -directory-filter option to run-clang-tidy.py (PR #89302)

2024-04-19 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. Personally I do not see use case for it, as source-filter also apply to directories, and better would be to just change source-filter to accept list of regexes. Other thing that directory-filter works as "exclude", not "includ

[clang-tools-extra] [run-clang-tidy.py] Add -directory-filter option to run-clang-tidy.py (PR #89302)

2024-04-19 Thread Piotr Zegar via cfe-commits
@@ -307,6 +307,14 @@ def main(): "source files from compilation database to output " "diagnostics from.", ) +parser.add_argument( +"-directory-filter", +dest="directory_filter", +action="append", +default=[], +help

[clang-tools-extra] [run-clang-tidy.py] Add -directory-filter option to run-clang-tidy.py (PR #89302)

2024-04-19 Thread Piotr Zegar via cfe-commits
@@ -514,7 +523,7 @@ def main(): # Fill the queue with files. for name in files: -if file_name_re.search(name): +if file_name_re.search(name) and not directory_filters_re.search(name): PiotrZSL wrote: to be honest those

[clang-tools-extra] [run-clang-tidy.py] Add -directory-filter option to run-clang-tidy.py (PR #89302)

2024-04-19 Thread Piotr Zegar via cfe-commits
@@ -307,6 +307,14 @@ def main(): "source files from compilation database to output " "diagnostics from.", ) +parser.add_argument( +"-directory-filter", PiotrZSL wrote: this basically work opposite to -source-filter, specially be

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -94,11 +155,12 @@ void UseStartsEndsWithCheck::check(const MatchFinder::MatchResult &Result) { Diagnostic << FixItHint::CreateRemoval(CharSourceRange::getCharRange( ComparisonExpr->getBeginLoc(), FindExpr->getBeginLoc())); - // Replace '(r?)find' with 'starts_with

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-21 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/89530 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][modernize-use-starts-ends-with] Add support for compare() (PR #89530)

2024-04-21 Thread Piotr Zegar via cfe-commits
@@ -16,6 +16,49 @@ using namespace clang::ast_matchers; namespace clang::tidy::modernize { +namespace { +// Given two argument indices X and Y, matches when a call expression has a +// string at index X with an expression representing that string's length at +// index Y. The s

<    13   14   15   16   17   18   19   20   21   22   >