https://github.com/PiotrZSL commented:
Overall doesn't look to bad, probably could be merged in +- this state, it need
to be run on some exist code-base like llvm. I will look again in next 1-2
days. Now just had quick glance.
https://github.com/llvm/llvm-project/pull/82403
___
@@ -0,0 +1,82 @@
+.. title:: clang-tidy - bugprone-crtp-constructor-accessibility
+
+bugprone-crtp-constructor-accessibility
+===
+
+Finds Curiously Recurring Template Pattern used in an error-prone way.
+
+The CRTP is an idiom, in which a class
@@ -100,6 +100,11 @@ Improvements to clang-tidy
New checks
^^
+- New :doc:`bugprone-crtp-constructor-accessibility
+ ` check.
+
+ Detects error-prone CRTP usage, when the CRTP can be constructed outside
itself and the derived class.
PiotrZSL wrote:
@@ -0,0 +1,177 @@
+//===--- CrtpConstructorAccessibilityCheck.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-Li
@@ -0,0 +1,82 @@
+.. title:: clang-tidy - bugprone-crtp-constructor-accessibility
+
+bugprone-crtp-constructor-accessibility
+===
+
+Finds Curiously Recurring Template Pattern used in an error-prone way.
PiotrZSL wrote:
"Detect
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/82403
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,177 @@
+//===--- CrtpConstructorAccessibilityCheck.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-Li
@@ -0,0 +1,232 @@
+// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t
+
+namespace class_implicit_ctor {
+template
+class CRTP {};
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor
of the CRTP is publicly accessible [bugprone-unsafe-crtp]
+// CHECK-
@@ -0,0 +1,167 @@
+//===--- UnsafeCrtpCheck.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/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/82416
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL approved this pull request.
LGTM, but update also check documentation, simply put there default config so
user could easily copy it change, and add new functions. And mention that this
support regexp.
https://github.com/llvm/llvm-project/pull/82952
_
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/82952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL commented:
LGTM
https://github.com/llvm/llvm-project/pull/83055
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL approved this pull request.
https://github.com/llvm/llvm-project/pull/83055
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/83055
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/82689
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/82689
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -79,8 +79,10 @@ static bool isStdInitializerList(QualType Type) {
}
void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) {
- constexpr char WarningMessage[] =
+ constexpr char NoExpressionWarningMessage[] =
"%0 must be marked explicit to avo
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
Author: Piotr Zegar
Date: 2024-02-29T20:53:30Z
New Revision: 21be2fbd17f9ff6f3f04e0ababc91c9cdd5aed85
URL:
https://github.com/llvm/llvm-project/commit/21be2fbd17f9ff6f3f04e0ababc91c9cdd5aed85
DIFF:
https://github.com/llvm/llvm-project/commit/21be2fbd17f9ff6f3f04e0ababc91c9cdd5aed85.diff
LOG: [
https://github.com/PiotrZSL created
https://github.com/llvm/llvm-project/pull/83716
This check identifies suspicious usages of std::string_view::data() that could
lead to reading out-of-bounds data due to inadequate or incorrect string null
termination.
Closes #80854
>From ce8017e7db56a43f2e
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/82689
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL approved this pull request.
Overall, LGTM
https://github.com/llvm/llvm-project/pull/82673
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?F=C3=A9lix-Antoine?= Constantin
Message-ID:
In-Reply-To:
PiotrZSL wrote:
Rebase, and could be merged.
https://github.com/llvm/llvm-project/pull/82952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mai
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/82403
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL approved this pull request.
Overall looks fine, at least fine to be merged.
I will try to take a deeper look into particular cases, but even if some
changes could be needed, probably better would be to merge this, and push fixes
in separate PR.
So lest merge this, a
@@ -0,0 +1,182 @@
+//===--- CrtpConstructorAccessibilityCheck.cpp - clang-tidy
+//-===//
PiotrZSL wrote:
This should be in single line
https://github.com/llvm/llvm-project/pull/82403
___
@@ -0,0 +1,182 @@
+//===--- CrtpConstructorAccessibilityCheck.cpp - clang-tidy
+//-===//
PiotrZSL wrote:
renamer...
https://github.com/llvm/llvm-project/pull/82403
___
cfe-commits mailin
=?utf-8?q?Félix-Antoine?= Constantin
Message-ID:
In-Reply-To:
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/82952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cf
https://github.com/PiotrZSL updated
https://github.com/llvm/llvm-project/pull/82673
>From 7dcbbae9656700bde30caf28f8105648e8dfc623 Mon Sep 17 00:00:00 2001
From: AMS21
Date: Thu, 22 Feb 2024 19:24:43 +0100
Subject: [PATCH] [clang-tidy] Let `bugprone-use-after-move` also handle calls
to `std::f
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/82673
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/83987
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL updated
https://github.com/llvm/llvm-project/pull/71701
>From 050d53bdbc01be93a15f6851faddc24e520f0472 Mon Sep 17 00:00:00 2001
From: Piotr Zegar
Date: Wed, 8 Nov 2023 16:52:06 +
Subject: [PATCH 1/4] [clang-tidy] Add AllowStringArrays option to
modernize-avoid-c
https://github.com/PiotrZSL approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/80181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL approved this pull request.
Looks fine.
For me check names are not the best, it's hard to figure out what they does.
Maybe they should be named like prefer-using-initialization-list and
prefer-using-in-class-initializers.
Simply because now member initializer could
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/71701
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Carlos =?utf-8?q?G=C3=A1lvez?=
Message-ID:
In-Reply-To:
https://github.com/PiotrZSL approved this pull request.
https://github.com/llvm/llvm-project/pull/80330
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
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?=
Message-ID:
In-Reply-To:
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/80541
__
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?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,42 @@
+//===--- UseDesignatedInitializersCheck.h - clang-tidy
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?=
Message-ID:
In-Reply-To:
https://github.com/PiotrZSL requested changes to this pull request.
Still some work is ne
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?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,77 @@
+//===--- UseDesignatedInitializersCheck.cpp - clang-tid
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?=
Message-ID:
In-Reply-To:
@@ -100,6 +100,12 @@ Improvements to clang-tidy
New checks
^^
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?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,77 @@
+//===--- UseDesignatedInitializersCheck.cpp - clang-tid
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?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,77 @@
+//===--- UseDesignatedInitializersCheck.cpp - clang-tid
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?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,48 @@
+// RUN: %check_clang_tidy -std=c++20 %s modernize-use-d
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?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,48 @@
+// RUN: %check_clang_tidy -std=c++20 %s modernize-use-d
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?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,77 @@
+//===--- UseDesignatedInitializersCheck.cpp - clang-tid
��___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/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?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,77 @@
+//===--- UseDesignatedInitializersCheck.cpp - clang-tid
https://github.com/PiotrZSL approved this pull request.
LGTM.
The only thing that I'm still thinking is if std is needed in name, and maybe
it should be like just use-min-max.
https://github.com/llvm/llvm-project/pull/77816
___
cfe-commits mailing lis
PiotrZSL wrote:
Unless you want this to be merged as
"76656712+11ha...@users.noreply.github.com", change your email privacy settings.
https://github.com/llvm/llvm-project/pull/77816
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists
https://github.com/PiotrZSL approved this pull request.
LGTM.
But please note that I'm not too familiar with coroutines.
https://github.com/llvm/llvm-project/pull/79206
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
https://github.com/PiotrZSL requested changes to this pull request.
Too overengineered. There are easier ways, just check comments.
Except that, looks +- fine.
https://github.com/llvm/llvm-project/pull/77816
___
cfe-commits mailing list
cfe-commits@lis
@@ -0,0 +1,230 @@
+// RUN: %check_clang_tidy %s readability-use-std-min-max %t
+#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b))
+
+constexpr int myConstexprMin(int a, int b) {
+ return a < b ? a : b;
+}
+
+constexpr int myConstexprMax(int a, int b) {
+ return a > b ? a : b;
+
@@ -0,0 +1,240 @@
+//===--- UseStdMinMaxCheck.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,240 @@
+//===--- UseStdMinMaxCheck.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,240 @@
+//===--- UseStdMinMaxCheck.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,240 @@
+//===--- UseStdMinMaxCheck.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/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/77816
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,240 @@
+//===--- UseStdMinMaxCheck.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,240 @@
+//===--- UseStdMinMaxCheck.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,240 @@
+//===--- UseStdMinMaxCheck.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,240 @@
+//===--- UseStdMinMaxCheck.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,240 @@
+//===--- UseStdMinMaxCheck.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,240 @@
+//===--- UseStdMinMaxCheck.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,230 @@
+// RUN: %check_clang_tidy %s readability-use-std-min-max %t
PiotrZSL wrote:
Add `-- -- -fno-delayed-template-parsing` this is why windows tests is falling.
Additionally explicitly set c++ standard with `-std=c++11-or-later` like in
other check
@@ -0,0 +1,168 @@
+//===--- UseStdMinMaxCheck.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/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/77816
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL commented:
Other thing is that reviewer should mark issues as resolved after checking with
code, not author. Otherwise is hard to figure out what's done and what's not.
Adding some comment like "Done" is sufficient usually unless issues are simple.
Next thing regard
@@ -0,0 +1,168 @@
+//===--- UseStdMinMaxCheck.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,168 @@
+//===--- UseStdMinMaxCheck.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/PiotrZSL updated
https://github.com/llvm/llvm-project/pull/71701
>From 050d53bdbc01be93a15f6851faddc24e520f0472 Mon Sep 17 00:00:00 2001
From: Piotr Zegar
Date: Wed, 8 Nov 2023 16:52:06 +
Subject: [PATCH 1/2] [clang-tidy] Add AllowStringArrays option to
modernize-avoid-c
PiotrZSL wrote:
> I may not work for
>
> ```c++
> void f(const char name[]);
>
> f("111");
> ```
It should not work, as this is not array, but pointer. If you do `sizeof(name)`
you get size of pointer, instead of number of elements in array.
https://github.com/llvm/llvm-project/pull/71701
__
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/77203
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL requested changes to this pull request.
Missing tests for arrays and function pointers to confirm that fix work.
+ some nits or possible improvments
https://github.com/llvm/llvm-project/pull/77943
___
cfe-commits mailing lis
@@ -333,6 +335,26 @@ void UseAutoCheck::replaceIterators(const DeclStmt *D,
ASTContext *Context) {
<< FixItHint::CreateReplacement(Range, "auto");
}
+namespace {
+
+void ignoreTypeLocClasses(
PiotrZSL wrote:
use static instead of anonymous namespace
h
@@ -333,6 +335,26 @@ void UseAutoCheck::replaceIterators(const DeclStmt *D,
ASTContext *Context) {
<< FixItHint::CreateReplacement(Range, "auto");
}
+namespace {
+
+void ignoreTypeLocClasses(
+TypeLoc &Loc, llvm::SmallVector const &LocClasses) {
+ while (llvm::is_c
@@ -405,12 +421,20 @@ void UseAutoCheck::replaceExpr(
auto Diag = diag(Range.getBegin(), Message);
+ bool ShouldReplenishVariableName = isMutliLevelPointerToTypeLocClasses(
+ FirstDecl->getTypeSourceInfo()->getTypeLoc(),
PiotrZSL wrote:
Would be nice
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/77943
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -333,6 +335,26 @@ void UseAutoCheck::replaceIterators(const DeclStmt *D,
ASTContext *Context) {
<< FixItHint::CreateReplacement(Range, "auto");
}
+namespace {
+
+void ignoreTypeLocClasses(
+TypeLoc &Loc, llvm::SmallVector const &LocClasses) {
+ while (llvm::is_c
@@ -333,6 +335,26 @@ void UseAutoCheck::replaceIterators(const DeclStmt *D,
ASTContext *Context) {
<< FixItHint::CreateReplacement(Range, "auto");
}
+namespace {
+
+void ignoreTypeLocClasses(
+TypeLoc &Loc, llvm::SmallVector const &LocClasses) {
Pio
@@ -405,12 +421,20 @@ void UseAutoCheck::replaceExpr(
auto Diag = diag(Range.getBegin(), Message);
+ bool ShouldReplenishVariableName = isMutliLevelPointerToTypeLocClasses(
+ FirstDecl->getTypeSourceInfo()->getTypeLoc(),
+ {TypeLoc::FunctionProto, TypeLoc::Consta
@@ -0,0 +1,20 @@
+// RUN: %check_clang_tidy -check-suffixes=,MACROS %s
readability-simplify-boolean-expr %t
+
+// Ignore expressions in macros.
+// RUN: %check_clang_tidy %s readability-simplify-boolean-expr %t
+// RUN: -- -config="{CheckOptions: [{key:
readability-simplify-
@@ -500,6 +500,10 @@ Changes in existing checks
` check to
identify calls to static member functions with out-of-class inline
definitions.
+- Added option `IgnoreMacros` to :doc:`readability-simplify-boolean-expr
PiotrZSL wrote:
follow current style of c
@@ -277,6 +277,9 @@ class SimplifyBooleanExprCheck::Visitor : public
RecursiveASTVisitor {
}
bool dataTraverseStmtPre(Stmt *S) {
+if (Check->IgnoreMacros && S->getBeginLoc().isMacroID()) {
PiotrZSL wrote:
what if S is nullptr ? it will crash, move S
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/76315
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Danny =?utf-8?q?M=C3=B6sch?= ,
Danny =?utf-8?q?M=C3=B6sch?= ,
Danny =?utf-8?q?M=C3=B6sch?=
Message-ID:
In-Reply-To:
@@ -492,6 +492,10 @@ Changes in existing checks
` check to ignore
false-positives in initializer list of record.
+- Added option `IgnoreMacros` to :doc:`r
Danny =?utf-8?q?Mösch?= ,
Danny =?utf-8?q?Mösch?= ,
Danny =?utf-8?q?Mösch?=
Message-ID:
In-Reply-To:
@@ -0,0 +1,20 @@
+// RUN: %check_clang_tidy -check-suffixes=,MACROS %s
readability-simplify-boolean-expr %t
+
+// Ignore expressions in macros.
+// RUN: %check_clang_tidy %s re
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?=
Message-ID:
In-Reply-To:
@@ -492,9 +492,9 @@ Changes in existing checks
` check to ignore
false-positives in initializer list of record.
-- Ad
Danny =?utf-8?q?M=C3=B6sch?= ,
Danny =?utf-8?q?M=C3=B6sch?= ,
Danny =?utf-8?q?M=C3=B6sch?= ,
Danny =?utf-8?q?M=C3=B6sch?= ,
Danny =?utf-8?q?M=C3=B6sch?=
Message-ID:
In-Reply-To:
https://github.com/PiotrZSL approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/78043
__
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?=
Message-ID:
In-Reply-To:
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/78043
___
cfe-commit
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/78022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL requested changes to this pull request.
Just few nits, from functional point of view check is good even now.
https://github.com/llvm/llvm-project/pull/78022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.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: Apache-
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.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: Apache-
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.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: Apache-
@@ -0,0 +1,20 @@
+.. title:: clang-tidy - readability-avoid-nested-conditional-operator
+
+readability-avoid-nested-conditional-operator
+=
+
+Finds nested conditional operator.
PiotrZSL wrote:
maybe:
`Identifies in
@@ -337,6 +337,7 @@ Clang-Tidy Checks
:doc:`portability-simd-intrinsics `,
:doc:`portability-std-allocator-const `,
:doc:`readability-avoid-const-params-in-decls
`, "Yes"
+ :doc:`readability-avoid-nested-conditional-operator
`, "Yes"
PiotrZSL wrote
@@ -0,0 +1,20 @@
+.. title:: clang-tidy - readability-avoid-nested-conditional-operator
+
+readability-avoid-nested-conditional-operator
+=
+
+Finds nested conditional operator.
+
+Nested conditional operators lead code hard to under
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.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: Apache-
701 - 800 of 2524 matches
Mail list logo