https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/122951
>From 841cfec5a0ab4ce5ce64e71facfb7becaf4340e8 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Tue, 14 Jan 2025 22:05:43 +0300
Subject: [PATCH 1/3] [clang-tidy] add AllowedTypes to misc-const-correctness
-
@@ -196,3 +196,13 @@ Options
// The following pointer may not become a 'int *const'.
int *changing_pointee = &value;
changing_pointee = &result;
+
+.. option:: AllowedTypes (default = '')
+
+ A semicolon-separated list of names of types that
+ will be excluded fro
@@ -196,3 +196,13 @@ Options
// The following pointer may not become a 'int *const'.
int *changing_pointee = &value;
changing_pointee = &result;
+
+.. option:: AllowedTypes (default = '')
+
+ A semicolon-separated list of names of types that
+ will be excluded fro
@@ -260,6 +260,11 @@ Changes in existing checks
` check to
report a location even when the member location is not valid.
+- Improved :doc:`misc-const-correctness
+ ` check by adding
+ the option ``AllowedTypes``, that excludes specified types
vbvictor wr
@@ -45,7 +45,7 @@ Options
copying. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
every type with suffix `Ref`, `ref`, `Reference` and `reference`. The
default
is empty. If a name in the list contains the sequence `::` it is matched
- against the
@@ -68,5 +68,5 @@ Options
Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches every type
with suffix `Ref`, `ref`, `Reference` and `reference`. The default is
empty. If a name in the list contains the sequence `::` it is matched
against
- the qualified
@@ -45,7 +45,7 @@ Options
copying. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
every type with suffix `Ref`, `ref`, `Reference` and `reference`. The
default
is empty. If a name in the list contains the sequence `::` it is matched
- against the
@@ -32,5 +32,5 @@ Options
iteration. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
every type with suffix `Ref`, `ref`, `Reference` and `reference`. The
default
is empty. If a name in the list contains the sequence `::` it is matched
- against th
@@ -196,3 +196,13 @@ Options
// The following pointer may not become a 'int *const'.
int *changing_pointee = &value;
changing_pointee = &result;
+
+.. option:: AllowedTypes (default = '')
+
+ A semicolon-separated list of names of types that
+ will be excluded fro
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/122951
>From 841cfec5a0ab4ce5ce64e71facfb7becaf4340e8 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Tue, 14 Jan 2025 22:05:43 +0300
Subject: [PATCH 1/4] [clang-tidy] add AllowedTypes to misc-const-correctness
-
@@ -196,3 +196,13 @@ Options
// The following pointer may not become a 'int *const'.
int *changing_pointee = &value;
changing_pointee = &result;
+
+.. option:: AllowedTypes (default = '')
+
+ A semicolon-separated list of names of types that
+ will be excluded fro
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/122957
>From 9c49e1e558c43d13872afe0a10345e3510afebdf Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Tue, 14 Jan 2025 22:30:03 +0300
Subject: [PATCH 1/2] [clang-tidy] Fix: typos in 'AllowedTypes' option in
vario
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From 92588a7eb3f87e74887e94f88d3402ec25c6ee53 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 9 Feb 2025 22:34:26 +0300
Subject: [PATCH 1/7] [clang-tidy] add modernize-use-scoped-lock check
---
.../
vbvictor wrote:
@PiotrZSL, I fixed all your comments and improved check by adding new
`WarnOnUsingAndTypedef` option.
I am still not sure whether It is good to have this option or not.
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits m
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/122951
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vbvictor wrote:
@HerrCai0907, I rebased on main, so no more conflicts.
I think this PR can also be merged, could you help please?
https://github.com/llvm/llvm-project/pull/122951
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llv
@@ -110,6 +110,11 @@ Changes in existing checks
` check by providing additional
examples and fixing some macro related false positives.
+- Improved :doc:`performance-noexcept-move-constructor
+ `. Check allows
vbvictor wrote:
```suggestion
` check to a
@@ -11,3 +11,16 @@ evaluates to ``false`` (but is not a ``false`` literal
itself).
Move constructors of all the types used with STL containers, for example,
need to be declared ``noexcept``. Otherwise STL will choose copy constructors
instead. The same is valid for move assign
@@ -0,0 +1,233 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,233 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,233 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,233 @@
+//===--- UseScopedLockCheck.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
@@ -91,6 +91,12 @@ Improvements to clang-tidy
New checks
^^
+- New :doc:`use-scoped-lock
vbvictor wrote:
Done
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits mailing list
cfe-commits@lists.
@@ -0,0 +1,81 @@
+.. title:: clang-tidy - modernize-use-scoped-lock
+
+modernize-use-scoped-lock
+=
+
+Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's more
+flexible and safer alternative ``std::scoped_lock``. The check will
+auto
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From 92588a7eb3f87e74887e94f88d3402ec25c6ee53 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 9 Feb 2025 22:34:26 +0300
Subject: [PATCH 1/6] [clang-tidy] add modernize-use-scoped-lock check
---
.../
@@ -0,0 +1,233 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,233 @@
+//===--- UseScopedLockCheck.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
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From 92588a7eb3f87e74887e94f88d3402ec25c6ee53 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 9 Feb 2025 22:34:26 +0300
Subject: [PATCH 1/5] [clang-tidy] add modernize-use-scoped-lock check
---
.../
@@ -0,0 +1,81 @@
+.. title:: clang-tidy - modernize-use-scoped-lock
+
+modernize-use-scoped-lock
+=
+
+Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's more
+flexible and safer alternative ``std::scoped_lock``. The check will
-
@@ -0,0 +1,50 @@
+//===--- UseScopedLockCheck.h - clang-tidy --*- 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
@@ -0,0 +1,81 @@
+.. title:: clang-tidy - modernize-use-scoped-lock
+
+modernize-use-scoped-lock
+=
+
+Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's more
+flexible and safer alternative ``std::scoped_lock``. The check will
+auto
@@ -0,0 +1,233 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,233 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,81 @@
+.. title:: clang-tidy - modernize-use-scoped-lock
+
+modernize-use-scoped-lock
+=
+
+Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's more
+flexible and safer alternative ``std::scoped_lock``. The check will
+auto
@@ -0,0 +1,333 @@
+// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t
-- -- -fno-delayed-template-parsing
+
+namespace std {
+
+struct mutex {
+ void lock() {}
+ void unlock() {}
+};
+
+template
+void lock(Lockable1& lock1, Lockable2& lock2, LockableN
@@ -0,0 +1,234 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,234 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,234 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,234 @@
+//===--- UseScopedLockCheck.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
@@ -0,0 +1,333 @@
+// RUN: %check_clang_tidy -std=c++17-or-later %s modernize-use-scoped-lock %t
-- -- -fno-delayed-template-parsing
+
+namespace std {
+
+struct mutex {
+ void lock() {}
+ void unlock() {}
+};
+
+template
+void lock(Lockable1& lock1, Lockable2& lock2, LockableN
@@ -109,6 +109,9 @@ Changes in existing checks
- Improved :doc:`misc-redundant-expression
` check by providing additional
examples and fixing some macro related false positives.
+
+- Improved :doc:`modernize-use-ranges
+ ` check by updating suppress
warnings logic for `
vbvictor wrote:
@PiotrZSL, @5chmidti Ping
https://github.com/llvm/llvm-project/pull/121291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -109,6 +109,9 @@ Changes in existing checks
- Improved :doc:`misc-redundant-expression
` check by providing additional
examples and fixing some macro related false positives.
+
+- Fixed a false positive in :doc:`modernize-use-ranges
vbvictor wrote:
``
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/127162
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -109,6 +109,9 @@ Changes in existing checks
- Improved :doc:`misc-redundant-expression
` check by providing additional
examples and fixing some macro related false positives.
+
+- Fixed a false positive in :doc:`modernize-use-ranges
+ `update the logic to suppress
wa
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/122951
>From 899a4d3e79b0b9f2c8c156624ebbf94f50696b61 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Tue, 14 Jan 2025 22:05:43 +0300
Subject: [PATCH 1/9] [clang-tidy] add AllowedTypes to misc-const-correctness
-
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/121291
>From 42e03bb9cc9bd815476b0a3f06ac5f58826e3708 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Fri, 31 Jan 2025 19:29:05 +0300
Subject: [PATCH 1/3] [clang-tidy] add new check bugprone-reset-ambiguous-call
vbvictor wrote:
If you squash commits solely for merging into main - there is no need for it
since they will be squashed automatically.
https://github.com/llvm/llvm-project/pull/126897
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://li
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/121291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,130 @@
+//===--- AmbiguousSmartptrResetCallCheck.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
@@ -0,0 +1,130 @@
+//===--- AmbiguousSmartptrResetCallCheck.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
@@ -0,0 +1,164 @@
+//===--- UseNumericLimitsCheck.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
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From 92588a7eb3f87e74887e94f88d3402ec25c6ee53 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 9 Feb 2025 22:34:26 +0300
Subject: [PATCH 1/8] [clang-tidy] add modernize-use-scoped-lock check
---
.../
@@ -0,0 +1,39 @@
+//===--- UseNumericLimitsCheck.h - clang-tidy ---*- 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
@@ -0,0 +1,39 @@
+//===--- UseNumericLimitsCheck.h - clang-tidy ---*- 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
@@ -0,0 +1,39 @@
+//===--- UseNumericLimitsCheck.h - clang-tidy ---*- 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
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From 92588a7eb3f87e74887e94f88d3402ec25c6ee53 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 9 Feb 2025 22:34:26 +0300
Subject: [PATCH 1/9] [clang-tidy] add modernize-use-scoped-lock check
---
.../
@@ -0,0 +1,84 @@
+// RUN: %check_clang_tidy %s readability-use-numeric-limits %t
+#include
+
+void constants() {
+ // CHECK-MESSAGES: :[[@LINE+2]]:14: warning: The constant -128 is being
utilized. Consider using std::numeric_limits::min() instead
[readability-use-numeric-limit
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/121291
>From 42e03bb9cc9bd815476b0a3f06ac5f58826e3708 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Fri, 31 Jan 2025 19:29:05 +0300
Subject: [PATCH 1/6] [clang-tidy] add new check bugprone-reset-ambiguous-call
@@ -0,0 +1,49 @@
+.. title:: clang-tidy - readability-ambiguous-smartptr-reset-call
+
+readability-ambiguous-smartptr-reset-call
+=
+
+Finds potentially erroneous calls to ``reset`` method on smart pointers when
+the pointee type also has a
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/121291
>From 42e03bb9cc9bd815476b0a3f06ac5f58826e3708 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Fri, 31 Jan 2025 19:29:05 +0300
Subject: [PATCH 1/7] [clang-tidy] add new check bugprone-reset-ambiguous-call
@@ -0,0 +1,84 @@
+// RUN: %check_clang_tidy %s readability-use-numeric-limits %t
+#include
+
+void constants() {
+ // CHECK-MESSAGES: :[[@LINE+2]]:14: warning: The constant -128 is being
utilized. Consider using std::numeric_limits::min() instead
[readability-use-numeric-limit
vbvictor wrote:
@PiotrZSL, @denzor200
I think we should provide 100% valid fix-its for default `SmartPointers`. That
will be `std::shared_ptr`, `std::unique_ptr`, `boost::shared_ptr`. I created a
note in docs that warns users about inconvenience that can happen when
non-default smart pointers
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/128362
Unify doc style for options that use `true` or `false` as default values.
>From 41807b8f379a19714fb89b2f13bc3af389c44ac0 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sat, 22 Feb 2025 17:26:52 +0300
Subj
vbvictor wrote:
@EugeneZelenko @HerrCai0907, Small change to docs of some checks.
https://github.com/llvm/llvm-project/pull/128362
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vbvictor wrote:
Thanks for fast approval!
@HerrCai0907, Could you merge, please.
https://github.com/llvm/llvm-project/pull/128362
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/121291
>From 42e03bb9cc9bd815476b0a3f06ac5f58826e3708 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Fri, 31 Jan 2025 19:29:05 +0300
Subject: [PATCH 1/8] [clang-tidy] add new check bugprone-reset-ambiguous-call
vbvictor wrote:
I changed option name from `WarnOnlyOnMultipleLocks` to `WarnOnSingleLocks`. I
think for users, it will be more clear what they turn on/off. When having
`WarnOnlyOnMultipleLocks` together with `WarnOnUsingAndTypedef` option, it is
confusing whether first option will disable war
@@ -0,0 +1,57 @@
+.. title:: clang-tidy - readability-ambiguous-smartptr-reset-call
+
+readability-ambiguous-smartptr-reset-call
+=
+
+Finds potentially erroneous calls to ``reset`` method on smart pointers when
+the pointee type also has a
@@ -0,0 +1,57 @@
+.. title:: clang-tidy - readability-ambiguous-smartptr-reset-call
+
+readability-ambiguous-smartptr-reset-call
+=
+
+Finds potentially erroneous calls to ``reset`` method on smart pointers when
+the pointee type also has a
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/121291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,68 @@
+// RUN: %check_clang_tidy %s readability-ambiguous-smartptr-reset-call %t \
vbvictor wrote:
I'd prefer to leave two separate files, they are easier to read and maintain
imho.
https://github.com/llvm/llvm-project/pull/121291
___
@@ -0,0 +1,129 @@
+//===--- AmbiguousSmartptrResetCallCheck.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
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/121291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vbvictor wrote:
Ping
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,146 @@
+//===--- SmartptrResetAmbiguousCallCheck.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
@@ -0,0 +1,146 @@
+//===--- SmartptrResetAmbiguousCallCheck.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
vbvictor wrote:
@PiotrZSL, thank you for pointing out better naming pattern for diag-messages,
would use it in the future.
1. Created new warning and fix-it messages.
2. Renamed check.
3. As for now, my check can support any type that will have `reset` method,
this include `std::optional`. May
@@ -0,0 +1,146 @@
+//===--- SmartptrResetAmbiguousCallCheck.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
@@ -0,0 +1,146 @@
+//===--- SmartptrResetAmbiguousCallCheck.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
@@ -0,0 +1,47 @@
+.. title:: clang-tidy - bugprone-smartptr-reset-ambiguous-call
+
+bugprone-smartptr-reset-ambiguous-call
+==
+
+Finds potentially erroneous calls to ``reset`` method on smart pointers when
+the pointee type also has a ``reset``
vbvictor wrote:
> 1. Please place value check in ast matcher part, match all integer will cost
> lots of cpu and ram to store temporary results.
Code in _clang-tools-extra\clang-tidy\bugprone\StringConstructorCheck.cpp_
maybe helpful since it shows work with numbers and have matcher `isBiggerT
@@ -0,0 +1,146 @@
+//===--- SmartptrResetAmbiguousCallCheck.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
@@ -0,0 +1,239 @@
+// RUN: %check_clang_tidy %s readability-ambiguous-smartptr-reset-call %t
--fix-notes --
+
+namespace std {
+
+template
+struct unique_ptr {
+ T& operator*() const;
+ T* operator->() const;
+ void reset(T* p = nullptr);
+};
+
+template
+struct shared_ptr {
@@ -0,0 +1,48 @@
+.. title:: clang-tidy - readability-ambiguous-smartptr-reset-call
+
+readability-ambiguous-smartptr-reset-call
+=
+
+Finds potentially erroneous calls to ``reset`` method on smart pointers when
+the pointee type also has a
@@ -0,0 +1,48 @@
+.. title:: clang-tidy - readability-ambiguous-smartptr-reset-call
+
+readability-ambiguous-smartptr-reset-call
+=
+
+Finds potentially erroneous calls to ``reset`` method on smart pointers when
+the pointee type also has a
@@ -0,0 +1,23 @@
+.. title:: clang-tidy - readability-use-numeric-limits
+
+readability-use-numeric-limits
+==
+
+ Replaces certain integer literals with equivalent calls to
+ ``std::numeric_limits::min()`` or ``std::numeric_limits::max()``.
+
+Before:
@@ -0,0 +1,41 @@
+//===--- UseNumericLimitsCheck.h - clang-tidy ---*- 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
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/127430
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/127430
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,41 @@
+//===--- UseNumericLimitsCheck.h - clang-tidy ---*- 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
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/127430
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,134 @@
+//===--- UseNumericLimitsCheck.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
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/127430
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,84 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s
readability-use-numeric-limits %t
+#include
+
+void constants() {
+ // CHECK-MESSAGES: :[[@LINE+2]]:14: warning: The constant -128 is being
utilized. Consider using std::numeric_limits::min() instead
[readabil
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/127430
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/121291
>From 42e03bb9cc9bd815476b0a3f06ac5f58826e3708 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Fri, 31 Jan 2025 19:29:05 +0300
Subject: [PATCH 1/5] [clang-tidy] add new check bugprone-reset-ambiguous-call
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/121291
>From 42e03bb9cc9bd815476b0a3f06ac5f58826e3708 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Fri, 31 Jan 2025 19:29:05 +0300
Subject: [PATCH 1/4] [clang-tidy] add new check bugprone-reset-ambiguous-call
@@ -0,0 +1,41 @@
+//===--- UseNumericLimitsCheck.h - clang-tidy ---*- 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
https://github.com/vbvictor deleted
https://github.com/llvm/llvm-project/pull/127430
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
101 - 200 of 465 matches
Mail list logo