@@ -318,17 +321,15 @@ void testPrivateContains(CustomMapPrivateContains &MyMap,
if (MyMap2.count(0)) {};
}
-struct MyString {};
-
struct WeirdNonMatchingContains {
unsigned count(char) const;
- bool contains(const MyString&) const;
+ bool contains(const std::string&) c
@@ -458,3 +454,41 @@ void testOperandPermutations(std::map& Map) {
// CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use 'contains' to check
for membership [readability-container-contains]
// CHECK-FIXES: if (!Map.contains(0)) {};
}
+
+void testStringNpos(std::string St
@@ -1,4 +1,7 @@
-// RUN: %check_clang_tidy -std=c++11-or-later %s
readability-container-contains %t
+// RUN: %check_clang_tidy -std=c++11-or-later %s
readability-container-contains %t -- \
localspook wrote:
```suggestion
// RUN: %check_clang_tidy %s readability
https://github.com/localspook closed
https://github.com/llvm/llvm-project/pull/147553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
localspook wrote:
Re: adding it under an option
I'm struggling to imagine a user that wants this change:
```diff
- int i = 10;
+ int const i = 10;
```
but *doesn't* want this change:
```diff
- auto i = 10;
+ auto const i = 10;
```
The way I see it, this PR is more of a bugfix rather than a new f
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/157319
>From e28e9e234b6165b49884cf254e1fb4efe44fe756 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sat, 6 Sep 2025 17:35:36 -0700
Subject: [PATCH 1/3] [clang-tidy] make `misc-const-correctness` work with
localspook wrote:
> I notice now there's no update in Release Notes for this.
There is though; did you maybe mean documentation?
https://github.com/llvm/llvm-project/pull/157319
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.ll
@@ -10,6 +10,12 @@ template
void type_dependent_variables() {
T value = 42;
auto &ref = value;
+ // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'ref' of type 'int &' can
be declared 'const'
+ // CHECK-FIXES: auto const&ref = value;
+ //
+ // FIXME: This is a fals
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/157319
>From e28e9e234b6165b49884cf254e1fb4efe44fe756 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sat, 6 Sep 2025 17:35:36 -0700
Subject: [PATCH 1/2] [clang-tidy] make `misc-const-correctness` work with
@@ -10,6 +10,12 @@ template
void type_dependent_variables() {
T value = 42;
auto &ref = value;
+ // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'ref' of type 'int &' can
be declared 'const'
+ // CHECK-FIXES: auto const&ref = value;
localspook wrote
@@ -185,6 +185,10 @@ Changes in existing checks
adding an option to allow pointer arithmetic via prefix/postfix increment or
decrement operators.
+- Improved :doc:`misc-const-correctness
+ ` check to diagnose
+ variables declared with ``auto``.
localspoo
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/157319
Fixes #60789.
Currently, the check will never make `auto` variables `const`. Here's the
relevant bit of code:
https://github.com/llvm/llvm-project/blob/6b200e21adec0e28407def6fcb2e6c7359fd881b/clang-tools-e
@@ -31,8 +31,6 @@ class NoLintDirectiveHandler {
public:
NoLintDirectiveHandler();
~NoLintDirectiveHandler();
localspook wrote:
This check does backflips to keep the definition of `Impl` out of the header,
and this is one of those backflips. The destructo
localspook wrote:
Tell me if I’m understanding correctly:
Your concern is with the API of a class. That means you’re concerned about
changes to `public` and `protected` methods, but okay with changes to `private`
ones?
https://github.com/llvm/llvm-project/pull/156265
_
https://github.com/localspook closed
https://github.com/llvm/llvm-project/pull/152401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -574,22 +574,30 @@ int ClangTool::run(ToolAction *Action) {
continue;
}
for (CompileCommand &CompileCommand : CompileCommandsForFile) {
+ // If the 'directory' field of the compilation database is empty, display
+ // an error and use the working direc
@@ -122,6 +122,10 @@ Improvements to clang-tidy
- Improved :program:`clang-tidy` option `-quiet` by suppressing diagnostic
count messages.
+- Improved :program:`run-clang-tidy.py` and :program:`clang-tidy-diff.py`
+ scripts by adding the `-hide-progress` option to suppress
https://github.com/localspook closed
https://github.com/llvm/llvm-project/pull/156584
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
localspook wrote:
Because of the new `wb` suffix. I should’ve just added `wW`
https://github.com/llvm/llvm-project/pull/156584
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/156584
This is a regression I introduced in #148275 and was [noticed
by](https://github.com/llvm/llvm-project/pull/148275#issuecomment-3246670841)
@nettle. The check incorrectly fires on hex literals containing the
localspook wrote:
Good catch, thank you! Opened #156584 with a fix.
https://github.com/llvm/llvm-project/pull/148275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
localspook wrote:
That CI failure looks unrelated.
https://github.com/llvm/llvm-project/pull/148275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/156265
>From c368372b8cc915a401a5dcbf6346e23a101f95e4 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sun, 31 Aug 2025 17:18:42 -0700
Subject: [PATCH 1/2] [clang-tidy][NFC] Enable
`readability-convert-member
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/156265
Closes #156158.
Ironically, one warning found in `ConvertMemberFunctionsToStatic.cpp`
>From c368372b8cc915a401a5dcbf6346e23a101f95e4 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sun, 31 Aug 2025 1
https://github.com/localspook closed
https://github.com/llvm/llvm-project/pull/148275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/156220
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/156220
Fixes #155680. See that issue for context.
The precise heuristic this PR implements is this: *none of the conditions in a
chain will be shortened if any of them contains the `defined` operator but
cannot be
@@ -0,0 +1,132 @@
+//===--===//
+//
+// 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,127 @@
+//===--===//
+//
+// 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
@@ -153,6 +154,8 @@ class BugproneModule : public ClangTidyModule {
"bugprone-incorrect-enable-if");
CheckFactories.registerCheck(
"bugprone-incorrect-enable-shared-from-this");
+CheckFactories.registerCheck(
+"bugprone-derived-method-shadowing-b
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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,127 @@
+//===--===//
+//
+// 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
@@ -31,6 +31,7 @@ add_clang_library(clangTidyBugproneModule STATIC
IncorrectEnableIfCheck.cpp
IncorrectEnableSharedFromThisCheck.cpp
InvalidEnumDefaultInitializationCheck.cpp
+ DerivedMethodShadowingBaseMethodCheck.cpp
localspook wrote:
Ditto alphabetic
@@ -0,0 +1,127 @@
+//===--===//
+//
+// 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,162 @@
+// TODO: When Clang adds support for decimal floating point types, enable
these tests by:
+//1. Removing all the #if 0 + #endif guards.
+//2. Removing all occurrences of the string "DISABLED-" in this file.
+//3. Deleting this message.
+
+// RUN: %c
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/148275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,162 @@
+// TODO: When Clang adds support for decimal floating point types, enable
these tests by:
+//1. Removing all the #if 0 + #endif guards.
+//2. Removing all occurrences of the string "DISABLED-" in this file.
+//3. Deleting this message.
+
+// RUN: %c
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/148275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,162 @@
+// TODO: When Clang adds support for decimal floating point types, enable
these tests by:
+//1. Removing all the #if 0 + #endif guards.
+//2. Removing all occurrences of the string "DISABLED-" in this file.
+//3. Deleting this message.
+
+// RUN: %c
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/148275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/148275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/148275
>From b19ad9cda58288d727861bdd0a9d2a7cedc7c1a6 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Fri, 11 Jul 2025 11:35:50 -0700
Subject: [PATCH 1/6] [clang-tidy] Teach `readability-uppercase-literal-suf
@@ -0,0 +1,248 @@
+// TODO: When Clang adds support for C++23 floating-point types, enable these
tests by:
+//1. Removing all the #if 0 + #endif guards.
+//2. Removing all occurrences of the string "DISABLED-" in this file.
+//3. Deleting this message.
+// These suffi
@@ -0,0 +1,248 @@
+// TODO: When Clang adds support for C++23 floating-point types, enable these
tests by:
+//1. Removing all the #if 0 + #endif guards.
+//2. Removing all occurrences of the string "DISABLED-" in this file.
+//3. Deleting this message.
+// These suffi
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/148275
>From b19ad9cda58288d727861bdd0a9d2a7cedc7c1a6 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Fri, 11 Jul 2025 11:35:50 -0700
Subject: [PATCH 1/5] [clang-tidy] Teach `readability-uppercase-literal-suf
https://github.com/localspook closed
https://github.com/llvm/llvm-project/pull/155180
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/155180
`dependentNameTypeLoc` is unused. `dependentScopeDeclRefExpr` has appeared in
`ASTMatchers.h` since this code was written.
>From d4e27d738a71c1a9b0f2b699f41e74b3a8a41366 Mon Sep 17 00:00:00 2001
From: Victor
https://github.com/localspook closed
https://github.com/llvm/llvm-project/pull/155083
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook closed
https://github.com/llvm/llvm-project/pull/152938
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook closed
https://github.com/llvm/llvm-project/pull/150791
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/150791
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/155083
Hope I got them all...
>From 2e397d72b35e85d80da270f5509b9d2278770307 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sat, 23 Aug 2025 01:54:21 -0700
Subject: [PATCH] [clang-tidy] Mark bunch of checks
@@ -190,7 +190,7 @@ void ContainerSizeEmptyCheck::registerMatchers(MatchFinder
*Finder) {
const auto WrongComparend =
anyOf(stringLiteral(hasSize(0)),
userDefinedLiteral(hasLiteral(stringLiteral(hasSize(0,
-cxxConstructExpr(isDefaultConstruc
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/150791
>From 20eb165f1abd9bf7976a2c401579a1284258e13e Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sat, 26 Jul 2025 11:52:19 -0700
Subject: [PATCH 1/6] [clang-tidy] Stop ignoring `-std` argument in
`check
@@ -374,15 +373,23 @@ def parse_arguments() -> Tuple[argparse.Namespace,
List[str]]:
parser.add_argument(
"-std",
type=csv,
-default=["c++11-or-later"],
+default=None,
help="Passed to clang. Special -or-later values are expanded.",
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/150791
>From 20eb165f1abd9bf7976a2c401579a1284258e13e Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sat, 26 Jul 2025 11:52:19 -0700
Subject: [PATCH 1/5] [clang-tidy] Stop ignoring `-std` argument in
`check
@@ -1,9 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -Wno-int-conversion -triple x86_64-linux
-verify %s
localspook wrote:
The pointer is now always converted to `const void *`, so we no longer need to
disallow these integer conversions.
https://github.com/llvm/l
localspook wrote:
I've switched to `checkBuiltinArgument`, but it causes an issue that I'd like
input on before I continue.
`clang/test/CodeGen/catch-alignment-assumption-ignorelist.c` tests that UBSan
doesn't validate the alignment of pointers to volatile. With this change, the
`volatile`-ne
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/153552
>From 63c02556bc65571a84e27debde2e2cfd724a0e9b Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Thu, 14 Aug 2025 00:52:37 -0700
Subject: [PATCH 1/2] [clang][Sema] Diagnose passing function pointer to
`
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/153552
The first parameter of the builtin is `const void *`, and function pointers
aren't convertible to that. [GCC diagnoses
this](https://godbolt.org/z/67njxGE61).
>From 63c02556bc65571a84e27debde2e2cfd724a0e9b
@@ -78,6 +79,15 @@ matchEnableIfSpecializationImplTypename(TypeLoc TheType) {
if (!TD || TD->getName() != "enable_if")
return std::nullopt;
+const TemplateParameterList *Params = TD->getTemplateParameters();
+if (Params->size() != 2)
+ return std::nullop
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/152938
>From 728fc710260d529a604bf3692b18c9131061e070 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sun, 10 Aug 2025 12:25:26 -0700
Subject: [PATCH 1/4] [clang-tidy] Fix `modernize-use-constraints` crash on
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/151936
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -371,6 +392,21 @@ void
UnnecessaryCopyInitialization::diagnoseCopyFromLocalVar(
maybeIssueFixes(Ctx, Diagnostic);
}
+void UnnecessaryCopyInitialization::diagnoseCopyFromConstVarMember(
+const CheckContext &Ctx, const VarDecl &OldVar, const MemberExpr &ME) {
+ std::s
localspook wrote:
Latest commit fixes `enable_if_t`, it also causes this crash
https://github.com/llvm/llvm-project/pull/152938
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -78,6 +79,15 @@ matchEnableIfSpecializationImplTypename(TypeLoc TheType) {
if (!TD || TD->getName() != "enable_if")
return std::nullopt;
+const TemplateParameterList *Params = TD->getTemplateParameters();
+if (Params->size() != 2)
+ return std::nullop
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/152938
>From 728fc710260d529a604bf3692b18c9131061e070 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sun, 10 Aug 2025 12:25:26 -0700
Subject: [PATCH 1/3] [clang-tidy] Fix `modernize-use-constraints` crash on
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/152938
>From 728fc710260d529a604bf3692b18c9131061e070 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sun, 10 Aug 2025 12:25:26 -0700
Subject: [PATCH 1/2] [clang-tidy] Fix `modernize-use-constraints` crash on
@@ -78,6 +79,15 @@ matchEnableIfSpecializationImplTypename(TypeLoc TheType) {
if (!TD || TD->getName() != "enable_if")
return std::nullopt;
+const TemplateParameterList *Params = TD->getTemplateParameters();
+if (Params->size() != 2)
+ return std::nullop
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/152938
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/152938
Fixes #152868. See that issue for details.
>From 728fc710260d529a604bf3692b18c9131061e070 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sun, 10 Aug 2025 12:25:26 -0700
Subject: [PATCH] [clang-tidy]
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/152401
>From f09e05a1aee29d94e908c3ef73d422bad65a3b34 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Wed, 6 Aug 2025 15:31:55 -0700
Subject: [PATCH 1/5] [clang-tidy] Raise minimum standard level for several
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/152401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/152401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/152401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
localspook wrote:
`-fno-delayed-template-parsing` did the trick for some tests! And it was a good
hint that helped me figure out why the others were inconsistent:
`-fms-extensions` apparently enables C++98-style int-to-pointer conversions in
higher language versions, which affects the generate
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/152401
>From f09e05a1aee29d94e908c3ef73d422bad65a3b34 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Wed, 6 Aug 2025 15:31:55 -0700
Subject: [PATCH 1/4] [clang-tidy] Raise minimum standard level for several
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/151936
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -371,6 +392,21 @@ void
UnnecessaryCopyInitialization::diagnoseCopyFromLocalVar(
maybeIssueFixes(Ctx, Diagnostic);
}
+void UnnecessaryCopyInitialization::diagnoseCopyFromConstVarMember(
+const CheckContext &Ctx, const VarDecl &OldVar, const MemberExpr &ME) {
+ std::s
@@ -938,3 +938,59 @@ template bool OperatorWithNoDirectCallee(T t) {
ExpensiveToCopyType a2 = a1;
return a1 == t;
}
+
+bool CopiedFromParmVarField(const Struct &crs, const Struct cs, Struct &rs,
Struct s) {
+ const auto m1 = crs.Member;
+ // CHECK-MESSAGES: [[@LINE-1]]:1
localspook wrote:
All my comments above this message are resolved, but it seems I can't *mark*
them resolved (because I don't have commit permissions, I think?). Could
someone else resolve them for me?
https://github.com/llvm/llvm-project/pull/151936
___
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/152401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/152401
>From f09e05a1aee29d94e908c3ef73d422bad65a3b34 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Wed, 6 Aug 2025 15:31:55 -0700
Subject: [PATCH 1/3] [clang-tidy] Raise minimum standard level for several
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/152401
`modernize-replace-auto-ptr`, `modernize-use-equals-delete`, and
`modernize-use-auto` use `std::unique_ptr`, `= delete`, and `auto`
respectively, which are all C++11 features.
The interesting bit is `modern
@@ -369,6 +387,18 @@ void
UnnecessaryCopyInitialization::diagnoseCopyFromLocalVar(
maybeIssueFixes(Ctx, Diagnostic);
}
+void UnnecessaryCopyInitialization::diagnoseCopyFromConstLocalVarMember(
+const CheckContext &Ctx, const VarDecl &OldVar) {
+ auto Diagnostic =
+
@@ -170,6 +170,11 @@ Changes in existing checks
when the format string is converted to a different type by an implicit
constructor call.
+- Improved :doc:`performance-unnecessary-copy-initialization
+ ` check by
+ adding detection for the local variables initialized wit
@@ -939,3 +939,28 @@ template bool OperatorWithNoDirectCallee(T t) {
return a1 == t;
}
+bool CopiedFromConstRefParmVar(const Struct &crs, const Struct cs, Struct &rs,
Struct s) {
+ const auto m1 = crs.Member;
+ // CHECK-MESSAGES: [[@LINE-1]]:14: warning: local copy 'm1' o
@@ -610,9 +619,10 @@ void NarrowingConversionsCheck::handleBinaryOperator(const
ASTContext &Context,
void NarrowingConversionsCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *Op = Result.Nodes.getNodeAs("binary_op"))
-return handleBinaryOperator(*R
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/151356
>From 8dd39dd51cb3d199734defcb1c0626d608806812 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Wed, 30 Jul 2025 08:38:42 -0700
Subject: [PATCH 1/3] [clang-tidy][NFC] Enable
`readability-avoid-return-w
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/151356
>From 8dd39dd51cb3d199734defcb1c0626d608806812 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Wed, 30 Jul 2025 08:38:42 -0700
Subject: [PATCH 1/2] [clang-tidy][NFC] Enable
`readability-avoid-return-w
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/147809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook created
https://github.com/llvm/llvm-project/pull/151356
None
>From 8dd39dd51cb3d199734defcb1c0626d608806812 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Wed, 30 Jul 2025 08:38:42 -0700
Subject: [PATCH] [clang-tidy][NFC] Enable
`readability-avoid-return
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/149694
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/149934
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
localspook wrote:
> Given that there is pushback, its probably safe to split this up into smaller
> chunks and let the owners of the parts decide if they want it or not. I can
> say for the StaticAnalyzer and Analysis libraries its a welcomed change.
Yep, I've gone and limited the changes in t
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/149694
>From 823bfd458a0e03125d84fd676fbc284f09b50a5b Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sat, 19 Jul 2025 23:43:55 -0700
Subject: [PATCH 1/4] [clang-tidy] Make `modernize-use-using`'s fixits more
https://github.com/localspook updated
https://github.com/llvm/llvm-project/pull/149694
>From 823bfd458a0e03125d84fd676fbc284f09b50a5b Mon Sep 17 00:00:00 2001
From: Victor Chernyakin
Date: Sat, 19 Jul 2025 23:43:55 -0700
Subject: [PATCH 1/4] [clang-tidy] Make `modernize-use-using`'s fixits more
localspook wrote:
Nope; that's the preexisting issue I mention in the description. I believe
fixing it in the general case would require Clang to provide extra information
in `TypedefDecl`, something like a `SourceRange DeclSpecSeqRange`:
```cpp
typedef const int *ptr1, *ptr2;
^
https://github.com/localspook edited
https://github.com/llvm/llvm-project/pull/150791
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -19,13 +18,16 @@ void notRelated(int A, int B) {}
int addedTogether(int A, int B) { return add(A, B); } // NO-WARN: Passed to
same function.
+// FIXME: This triggers a false positive: the "passed to same function"
heuristic
+// can't map the parameter index 1 to A and B
1 - 100 of 203 matches
Mail list logo