vbvictor wrote:
> Generalizing this check to enforce either static or anonymous namespaces
> would be great
There is a check
[misc-use-anonymous-namespace](https://clang.llvm.org/extra/clang-tidy/checks/misc/use-anonymous-namespace.html)
that suggests converting `static` to anon namespace, so
@@ -0,0 +1,25 @@
+// RUN: %check_clang_tidy %s modernize-use-override %t -- \
+// RUN: -config="{CheckOptions: {modernize-use-override.AllowVirtual: true}}"
+
+struct Base {
+ virtual ~Base();
+ virtual void a();
+ virtual void b();
+ virtual void c();
+};
+
+struct Derived
@@ -0,0 +1,25 @@
+// RUN: %check_clang_tidy %s modernize-use-override %t -- \
+// RUN: -config="{CheckOptions: {modernize-use-override.AllowVirtual: true}}"
+
+struct Base {
+ virtual ~Base();
+ virtual void a();
+ virtual void b();
+ virtual void c();
+};
+
+struct Derived
@@ -0,0 +1,25 @@
+// RUN: %check_clang_tidy %s modernize-use-override %t -- \
+// RUN: -config="{CheckOptions: {modernize-use-override.AllowVirtual: true}}"
+
+struct Base {
+ virtual ~Base();
+ virtual void a();
+ virtual void b();
+ virtual void c();
+};
+
+struct Derived
https://github.com/vbvictor requested changes to this pull request.
Please add your change to ReleaseNotes.rst
https://github.com/llvm/llvm-project/pull/144916
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mail
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/144916
___
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/126434
>From 81a21a90e03e4b9cea58d6bcffddf3bde0f82710 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 3 Mar 2025 09:25:03 +0300
Subject: [PATCH 01/13] [clang-tidy] add scoped-lock-check
---
.../clang-tidy/m
vbvictor wrote:
> Could you add some separate tests for this diagnostic?
I've added tests with:
- with template functions
- deeper nesting
- multiple exceptions throw (as for now, it reports for only one, and I'd like
to leave it for first iteration)
If there are any more tests that I should,
@@ -0,0 +1,63 @@
+
+Query Based Custom Clang-Tidy Checks
+
+
+Introduction
+
+
+This page provides examples of how to add query based custom checks for
+:program:`clang-tidy`.
+
+Custom checks are
@@ -0,0 +1,146 @@
+//===--- QueryCheck.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,63 @@
+
+Query Based Custom Clang-Tidy Checks
+
+
+Introduction
+
+
+This page provides examples of how to add query based custom checks for
+:program:`clang-tidy`.
+
+Custom checks are
@@ -292,6 +293,8 @@ An overview of all the command-line options:
Checks - Same as '--checks'. Additionally, the list
of
globs can be specified as a list instead of
a
string.
+C
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/131804
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,63 @@
+
+Query Based Custom Clang-Tidy Checks
+
+
+Introduction
+
+
+This page provides examples of how to add query based custom checks for
+:program:`clang-tidy`.
+
+Custom checks are
@@ -0,0 +1,63 @@
+
+Query Based Custom Clang-Tidy Checks
+
+
+Introduction
+
+
+This page provides examples of how to add query based custom checks for
+:program:`clang-tidy`.
+
+Custom checks are
https://github.com/vbvictor commented:
Mostly docs suggestions. I like this approach with config file, but don't have
a strong opinion for now, so LGTM without explicit approval.
https://github.com/llvm/llvm-project/pull/131804
___
cfe-commits mailing
@@ -0,0 +1,63 @@
+
+Query Based Custom Clang-Tidy Checks
+
+
+Introduction
+
+
+This page provides examples of how to add query based custom checks for
+:program:`clang-tidy`.
+
+Custom checks are
vbvictor wrote:
Ping @HerrCai0907 @PiotrZSL @carlosgalvezp
https://github.com/llvm/llvm-project/pull/131669
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vbvictor wrote:
rebased + ping
https://github.com/llvm/llvm-project/pull/139430
___
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/139430
>From a5e4fbcf644279ad002f55f9f6ed506d7ab764a4 Mon Sep 17 00:00:00 2001
From: Baranov Victor
Date: Sun, 11 May 2025 05:22:55 +0300
Subject: [PATCH] [clang-tidy] fix false positives with type aliases in
pro-bou
vbvictor wrote:
Rebased + ping @PiotrZSL.
I'd merge it at the end of the month if there would be no more reviews.
https://github.com/llvm/llvm-project/pull/126434
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/126434
>From 81a21a90e03e4b9cea58d6bcffddf3bde0f82710 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Mon, 3 Mar 2025 09:25:03 +0300
Subject: [PATCH 01/12] [clang-tidy] add scoped-lock-check
---
.../clang-tidy/m
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/144274
___
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/144274
>From 98fc81696400be2ea990d867375530ef3f544b82 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 15 Jun 2025 22:20:54 +0300
Subject: [PATCH 1/3] [Clang] Fix '-Wformat-overflow' FP when floats had
field-
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/144274
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -43,6 +43,11 @@ void call_snprintf(double d, int n, int *ptr) {
__builtin_snprintf(node_name, sizeof(node_name), "%pOFn", ptr); //
nonkprintf-warning {{'snprintf' will always be truncated; specified size is 6,
but format string expands to at least 7}}
__builtin_snprintf
vbvictor wrote:
> Should I close this PR, and open a new one when I'm ready with the CSA
> checker?
To keep everything organized, I'd suggest creating a new branch for CSA checker
and close this PR (you can always reopen it later).
For the CSA part, you can start by reading [this developer
g
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/144274
>From 98fc81696400be2ea990d867375530ef3f544b82 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 15 Jun 2025 22:20:54 +0300
Subject: [PATCH 1/2] [Clang] Fix '-Wformat-overflow' FP when floats had
field-
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/142324
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -36,6 +37,8 @@ class PerformanceModule : public ClangTidyModule {
public:
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
CheckFactories.registerCheck("performance-avoid-endl");
+CheckFactories.registerCheck(
+"performance-bool-bi
@@ -104,7 +104,14 @@ Improvements to clang-tidy
clauses. Added a ``--match-partial-fixes`` option to keep previous behavior
on
specific tests. This may break tests for users with custom out-of-tree checks
who use :program:`check_clang_tidy.py` as-is.
-
+- :program:`clang
vbvictor wrote:
> At the moment of the previous PR, there was a concern about configurability
> of check
I think I was about adding an option to configure list of optional classes.
Probably `OptionalClasses` or similar.
I haven't seen issues about it, so it may not be a high priority.
https:/
@@ -104,7 +104,14 @@ Improvements to clang-tidy
clauses. Added a ``--match-partial-fixes`` option to keep previous behavior
on
specific tests. This may break tests for users with custom out-of-tree checks
who use :program:`check_clang_tidy.py` as-is.
-
+- :program:`clang
@@ -0,0 +1,111 @@
+//===--- QueryCheck.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
@@ -53,6 +53,11 @@
LLVM_INSTANTIATE_REGISTRY(clang::tidy::ClangTidyModuleRegistry)
namespace clang::tidy {
+namespace custom {
+extern void registerCustomChecks(ClangTidyOptions const &O,
vbvictor wrote:
```suggestion
extern void registerCustomChecks(const
@@ -0,0 +1,111 @@
+//===--- QueryCheck.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,111 @@
+//===--- QueryCheck.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,50 @@
+#include "../ClangTidy.h"
+#include "../ClangTidyModule.h"
+#include "../ClangTidyModuleRegistry.h"
+#include "../ClangTidyOptions.h"
+#include "QueryCheck.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringRef.h"
+#in
@@ -0,0 +1,111 @@
+//===--- QueryCheck.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
@@ -62,6 +62,8 @@ class ClangTidyCheckFactories {
});
}
+ void erase(llvm::StringRef CheckName) { Factories.erase(CheckName); }
vbvictor wrote:
```suggestion
void eraseCheck(llvm::StringRef CheckName) { Factories.erase(CheckName)
@@ -104,7 +104,14 @@ Improvements to clang-tidy
clauses. Added a ``--match-partial-fixes`` option to keep previous behavior
on
specific tests. This may break tests for users with custom out-of-tree checks
who use :program:`check_clang_tidy.py` as-is.
-
+- :program:`clang
@@ -0,0 +1,111 @@
+//===--- QueryCheck.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
@@ -17,6 +18,7 @@
#include "llvm/Support/MemoryBufferRef.h"
#include "llvm/Support/VirtualFileSystem.h"
#include
+#include
vbvictor wrote:
Is this include needed?
https://github.com/llvm/llvm-project/pull/131804
_
@@ -0,0 +1,111 @@
+//===--- QueryCheck.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,50 @@
+#include "../ClangTidy.h"
+#include "../ClangTidyModule.h"
+#include "../ClangTidyModuleRegistry.h"
+#include "../ClangTidyOptions.h"
+#include "QueryCheck.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringRef.h"
+#in
@@ -0,0 +1,50 @@
+#include "../ClangTidy.h"
+#include "../ClangTidyModule.h"
+#include "../ClangTidyModuleRegistry.h"
+#include "../ClangTidyOptions.h"
+#include "QueryCheck.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringRef.h"
+#in
@@ -0,0 +1,63 @@
+
+Query Based Custom Clang-Tidy Checks
+
+
+Introduction
+
+
+This page provides examples of how to add query based custom checks for
+:program:`clang-tidy`.
+
+Custom checks are
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/143554
>From 5c975c6b59c02b0464a9bfc1b424b89b4d7dd662 Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Tue, 10 Jun 2025 18:27:12 +0300
Subject: [PATCH 1/3] [clang-tidy] add 'IgnoreMarcos' option to 'avoid-goto'
ch
https://github.com/vbvictor updated
https://github.com/llvm/llvm-project/pull/144270
>From 07392e16740d3d89700da43e22b4d90197bb4d4a Mon Sep 17 00:00:00 2001
From: Victor Baranov
Date: Sun, 15 Jun 2025 19:56:05 +0300
Subject: [PATCH 1/2] [Clang] Improve diagnostics when 'placement new' was
call
@@ -132,8 +133,41 @@ void jump_out_backwards() {
for (int j = 0; j < 10; ++j) {
if (i * j > 80)
goto before_the_loop;
- // CHECK-NOTES: [[@LINE-1]]:9: warning: avoid using 'goto' for flow
control
- // CHECK-NOTES: [[@LINE-8]]:1: note: label defined
@@ -50,3 +50,12 @@ Modern C++ needs ``goto`` only to jump out of nested loops.
some_operation();
All other uses of ``goto`` are diagnosed in `C++`.
+
+
+Options
+---
+
+.. option:: IgnoreMacros
+
+ If set to `true`, the check will not warn if both label and ``goto``
+
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/144274
If field width is specified, the sign/space is already accounted for within the
field width, so no additional size is needed.
Fixes https://github.com/llvm/llvm-project/issues/143951.
>From 98fc81696400be2ea9
vbvictor wrote:
Failed "[Test documentation
build](https://github.com/llvm/llvm-project/actions/runs/15665481196/job/44129065574?pr=144270)"
also fails without my commit, so it is unrelated
https://github.com/llvm/llvm-project/pull/144270
___
cfe-com
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
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,163 @@
+//===--- 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
@@ -0,0 +1,90 @@
+// RUN: %check_clang_tidy %s readability-use-numeric-limits %t
+#include
vbvictor wrote:
Please don't use real headers for your test file.
All you need is to mimic a small portion of `typedef`'s for `int8_t`, `uint8_t`
etc..
Write them yourse
@@ -0,0 +1,90 @@
+// RUN: %check_clang_tidy %s readability-use-numeric-limits %t
+#include
+
vbvictor wrote:
Please add CHECK-FIXES for the header you include (look at other tests for
reference)
https://github.com/llvm/llvm-project/pull/127430
https://github.com/vbvictor approved this pull request.
LGTM, with few with nits
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,31 @@
+.. 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()``.
-
@@ -0,0 +1,163 @@
+//===--- 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
@@ -0,0 +1,163 @@
+//===--- 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
@@ -0,0 +1,38 @@
+//===--- 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/144270
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vbvictor created
https://github.com/llvm/llvm-project/pull/144270
Before this patch, the following code gave misleading diagnostics about absence
of `#include `:
```cpp
struct X { int n; };
int foo() {
const X cx = {5};
// error: no matching 'operator new' function for no
@@ -0,0 +1,163 @@
+//===--- 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
@@ -0,0 +1,163 @@
+//===--- 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 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
@@ -0,0 +1,31 @@
+.. 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()``.
---
@@ -0,0 +1,163 @@
+//===--- 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
@@ -117,6 +117,13 @@ Improvements to clang-tidy
New checks
^^
+- New :doc:`readability-use-numeric-limits
vbvictor wrote:
Please delete this entry, looks like wrong merge artifact
https://github.com/llvm/llvm-project/pull/127430
_
@@ -0,0 +1,163 @@
+//===--- 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/142324
___
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/142324
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,208 @@
+//===--- BoolBitwiseOperationCheck.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,208 @@
+//===--- BoolBitwiseOperationCheck.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,208 @@
+//===--- BoolBitwiseOperationCheck.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,208 @@
+//===--- BoolBitwiseOperationCheck.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,208 @@
+//===--- BoolBitwiseOperationCheck.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,208 @@
+//===--- BoolBitwiseOperationCheck.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,208 @@
+//===--- BoolBitwiseOperationCheck.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,208 @@
+//===--- BoolBitwiseOperationCheck.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,208 @@
+//===--- BoolBitwiseOperationCheck.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,208 @@
+//===--- BoolBitwiseOperationCheck.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 approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/143292
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -215,10 +236,18 @@ static bool overlap(ArrayRef SCC,
/// returns true iff `Cond` involves at least one static local variable.
static bool hasStaticLocalVariable(const Stmt *Cond) {
- if (const auto *DRE = dyn_cast(Cond))
+ if (const auto *DRE = dyn_cast(Cond)) {
if (
@@ -83,6 +83,23 @@ static bool isVarThatIsPossiblyChanged(const Decl *Func,
const Stmt *LoopStmt,
isChanged(LoopStmt, Var, Context);
// FIXME: Track references.
}
+
+if (const auto *BD = dyn_cast(DRE->getDecl())) {
+ if (const auto *DD =
+
https://github.com/vbvictor closed
https://github.com/llvm/llvm-project/pull/143558
___
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/67467
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -148,6 +148,12 @@ New checks
Finds potentially erroneous calls to ``reset`` method on smart pointers when
the pointee type also has a ``reset`` method.
+- New :doc:`bugprone-move-shared-pointer-contents
vbvictor wrote:
Please place in alphabetical orde
@@ -0,0 +1,137 @@
+//===--- 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
@@ -0,0 +1,137 @@
+//===--- 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
@@ -132,8 +133,41 @@ void jump_out_backwards() {
for (int j = 0; j < 10; ++j) {
if (i * j > 80)
goto before_the_loop;
- // CHECK-NOTES: [[@LINE-1]]:9: warning: avoid using 'goto' for flow
control
- // CHECK-NOTES: [[@LINE-8]]:1: note: label defined
vbvictor wrote:
Please ping me when you're done working and want to test CI build
I need to approve every CI build/format run... not very convenient.
https://github.com/llvm/llvm-project/pull/67467
___
cfe-commits mailing list
cfe-commits@lists.llvm.or
vbvictor wrote:
I agree that modelling `assert(sp.use_count() == 1);` is not easy in
`clang-tidy` itself. In one of my checks I needed to check that two `declStmt`
are placed one after another in `compoundStmt` and I ended up manually
traversing all `stmt` within `compoundStmt` - not a very pl
vbvictor wrote:
Ping
https://github.com/llvm/llvm-project/pull/141304
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vbvictor wrote:
Thank you for your long and detailed answer! Indeed, the check can benefit a
lot from path-sensitive analysis:
- Easier traversing with less boilerplate code.
- Easier handling of edge-cases like struct fields and unions, support of local
variables.
- Fewer false-positives with
https://github.com/vbvictor edited
https://github.com/llvm/llvm-project/pull/140912
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
1 - 100 of 883 matches
Mail list logo