=��___
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/96917
___
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/96617
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID:
In-Reply-To:
https://github.com/PiotrZSL commented:
Code looks fine.
Only thing is that existence of SuppressInlineNamespace and
AlwaysSuppressInlineNamespace looks redundant.
Probably one should be named SuppressRedundantInlineNamespace and othe
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/111405
___
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/110428
___
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/110428
___
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/113833
___
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/115302
___
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/112091
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,8 +1,8 @@
-// RUN: %check_clang_tidy -std=c++11-or-later %s readability-redundant-casting
%t -- -- -fno-delayed-template-parsing
-// RUN: %check_clang_tidy -std=c++11-or-later -check-suffix=,MACROS %s
readability-redundant-casting %t -- \
+// RUN: %check_clang_tidy -std=c+
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/109741
___
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.
Except single comment, looks fine.
https://github.com/llvm/llvm-project/pull/109741
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/116591
___
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.
Consider just changing default value of WarnOnIntegerNarrowingConversion option.
https://github.com/llvm/llvm-project/pull/116591
___
cfe-commits mailing list
cfe-commits@lists.llvm.or
PiotrZSL wrote:
Actually only thing that were missing were example.
Added test. I'm not adding release notes as this is crash on invalid anyway,
and I don't want to add multiple entrys, as this impact multiple checks.
https://github.com/llvm/llvm-project/pull/66810
_
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/66810
___
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/66810
>From c808abe4dcba2a523552863bf7a32736e6bbbc37 Mon Sep 17 00:00:00 2001
From: Piotr Zegar
Date: Tue, 19 Sep 2023 19:05:00 +
Subject: [PATCH] [clang-tidy] Add recursion protection in
ExceptionSpecAnalyzer
N
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/66810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
PiotrZSL wrote:
You understand that this check does not apply only to std:: containers but also
to boost and other custom one that have size and empty methods. In such case
claim is still valid. If you change check description, then check documentation
also should be updated to be in sync.
ht
https://github.com/PiotrZSL requested changes to this pull request.
Documentation & Test for matcher is missing.
Except that everything looks ok.
https://github.com/llvm/llvm-project/pull/117901
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
@@ -1236,6 +1236,17 @@ AST_MATCHER_P(TemplateArgument, equalsIntegralValue,
extern const internal::VariadicDynCastAllOfMatcher autoreleasePoolStmt;
+/// Matches any export declaration.
+///
+/// Example matches following declarations.
+/// \code
+/// export void foo();
+///
@@ -1236,6 +1236,17 @@ AST_MATCHER_P(TemplateArgument, equalsIntegralValue,
extern const internal::VariadicDynCastAllOfMatcher autoreleasePoolStmt;
+/// Matches any export declaration.
+///
+/// Example matches following declarations.
+/// \code
+/// export void foo();
+///
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/117901
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin
Message-ID:
In-Reply-To:
https://github.com/PiotrZSL requested changes to this pull request.
Please implement this change under separate option like:
`AllowEnumsBeRecognizedAs Alias
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin
Message-ID:
In-Reply-To:
@@ -221,3 +221,16 @@ void testRedundantDependentNTTPCasting() {
// CHECK-MESSAGES: :[[@LINE-4]]:25: note: source type originates from
ref
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin
Message-ID:
In-Reply-To:
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/111424
___
cfe-commits mailing list
https://github.com/PiotrZSL approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/117474
___
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/117490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -18,14 +18,17 @@ namespace clang::tidy::bugprone {
void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) {
const auto DRef = ignoringParens(
declRefExpr(
- to(parmVarDecl(hasType(hasCanonicalType(
- qualType
@@ -151,6 +151,12 @@ void instantiate(const int ¶m, const float ¶mf,
int &mut_param, float &m
itf6(mut_paramf);
}
+template
+void f(const T& t) {
+const auto get = [&t] -> const T& { return t; };
+return T{};
+}
PiotrZSL wrote:
Please add tes
https://github.com/PiotrZSL requested changes to this pull request.
Please add positive test for lambdas.
https://github.com/llvm/llvm-project/pull/117734
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/li
https://github.com/PiotrZSL approved this pull request.
https://github.com/llvm/llvm-project/pull/114544
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
PiotrZSL wrote:
> @PiotrZSL The ping was in case you want to be added as a maintainer to
> clang-tidy as well. I’m mentioning it just to make sure.
The designation of "maintainer" does not impact the established process. This
role primarily introduces additional responsibilities without offeri
https://github.com/PiotrZSL approved this pull request.
https://github.com/llvm/llvm-project/pull/117901
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
PiotrZSL wrote:
> This class could maintain a stack-like `SmallVector` to check for an infinite
> recursion., so instead of checking the function cache (which might be large),
> only a few functions have to be compared this way.
Actually this change does not impact performance. Before we had 2
https://github.com/PiotrZSL requested changes to this pull request.
You modify also check related to make_unique.
Do:
- Add MakeSmartPtrType in MakeSmartPtrCheck as protected (do not initialize in
constructor)
- Add MakeSmartPtrType to storeOptions
- Read MakeSmartPtrType in MakeSharedPtrCheck &
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/117529
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -46,6 +46,7 @@ MakeSmartPtrCheck::MakeSmartPtrCheck(StringRef Name,
ClangTidyContext *Context,
areDiagsSelfContained()),
MakeSmartPtrFunctionHeader(
Options.get("MakeSmartPtrFunctionHeader", "")),
+ MakeSmartPtrType(Options.get("MakeSmart
@@ -26,6 +26,9 @@ namespace clang::tidy::modernize {
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/modernize/make-shared.html
class MakeSharedCheck : public MakeSmartPtrCheck {
+private:
+ const StringRef MakeSmartPtrType;
---
@@ -16,13 +16,14 @@ using namespace clang::ast_matchers;
namespace clang::tidy::modernize {
MakeSharedCheck::MakeSharedCheck(StringRef Name, ClangTidyContext *Context)
-: MakeSmartPtrCheck(Name, Context, "std::make_shared") {}
+: MakeSmartPtrCheck(Name, Context, "std::
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/114544
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,72 @@
+=
+Clang Tools Extra Maintainers
+=
+
+This file is a list of the maintainers
+(https://llvm.org/docs/DeveloperPolicy.html#maintainers) for clang-tools-extra.
+
+
+Active Maintainers
+==
+The
https://github.com/PiotrZSL commented:
Hmm, Then you may consider adding me.
https://github.com/llvm/llvm-project/pull/114544
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -393,8 +393,14 @@ void NarrowingConversionsCheck::handleIntegralCast(const
ASTContext &Context,
const Expr &Lhs,
const Expr &Rhs) {
if (WarnOnIntegerNarrowingConversion)
https://github.com/PiotrZSL updated
https://github.com/llvm/llvm-project/pull/66553
>From d5154cfc658dd67a3990c5c944c50114cbde0092 Mon Sep 17 00:00:00 2001
From: Piotr Zegar
Date: Fri, 15 Sep 2023 21:39:17 +
Subject: [PATCH] [clang-tidy] Fix handling --driver-mode=
Driver mode passed as an
PiotrZSL wrote:
Rebased, bump
https://github.com/llvm/llvm-project/pull/66553
___
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/117629
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -27,6 +27,29 @@ This check will flag:
- All applications of binary operators with a narrowing conversions.
For example: ``int i; i+= 0.1;``.
+Note that arithmetic with integer types may perform implicit conversions if
the used integer types are smaller than ``int``.
+T
@@ -27,6 +27,29 @@ This check will flag:
- All applications of binary operators with a narrowing conversions.
For example: ``int i; i+= 0.1;``.
+Note that arithmetic with integer types may perform implicit conversions if
the used integer types are smaller than ``int``.
+T
@@ -27,6 +27,29 @@ This check will flag:
- All applications of binary operators with a narrowing conversions.
For example: ``int i; i+= 0.1;``.
+Note that arithmetic with integer types may perform implicit conversions if
the used integer types are smaller than ``int``.
--
@@ -27,6 +27,29 @@ This check will flag:
- All applications of binary operators with a narrowing conversions.
For example: ``int i; i+= 0.1;``.
+Note that arithmetic with integer types may perform implicit conversions if
the used integer types are smaller than ``int``.
--
https://github.com/PiotrZSL requested changes to this pull request.
- Formatting
- Please think about simplifying this.
https://github.com/llvm/llvm-project/pull/118209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/118209
___
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.
1. Consider TK_IgnoreUnlessSpelledInSource, may simplify matchers
2. Name is too generic, consider:
- bugprone-smartptr-reset-pointee-reset
- bugprone-smartptr-reset-call
- bugprone-smartptr-pointee-reset
- bugprone-smartptr-
@@ -0,0 +1,159 @@
+//===--- RedundantLookupCheck.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,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,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
-
@@ -91,6 +91,12 @@ Improvements to clang-tidy
New checks
^^
+- New :doc:`use-scoped-lock
PiotrZSL wrote:
```suggestion
- New :doc:`modernize-use-scoped-lock
```
https://github.com/llvm/llvm-project/pull/126434
@@ -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/PiotrZSL commented:
Few nits, but overall not bad.
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,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,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,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,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/PiotrZSL edited
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
@@ -12,20 +12,44 @@
#include "../utils/OptionsUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include
using namespace clang::ast_matchers;
+using clang::ast_matchers::internal::Matcher;
namespace clang::tidy::bugprone {
names
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/119371
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/PiotrZSL commented:
Note: Probably also std::make_optional could be supported.
Please improve performance - avoid creating temporary matchers on every match.
Except above, looks fine.
https://github.com/llvm/llvm-project/pull/119371
___
@@ -12,20 +12,44 @@
#include "../utils/OptionsUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include
using namespace clang::ast_matchers;
+using clang::ast_matchers::internal::Matcher;
namespace clang::tidy::bugprone {
names
https://github.com/PiotrZSL approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/119346
___
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.
- reformat code
- missing release notes entry about new options added
- missing documentation for newly added options
- change should be in registerMatchers method
https://github.com/llvm/llvm-project/pull/120087
___
@@ -0,0 +1,86 @@
+// RUN: %check_clang_tidy %s readability-implicit-bool-conversion %t
+
+// RUN: %check_clang_tidy %s readability-implicit-bool-conversion %t \
+// RUN: -- -config='{CheckOptions: [{key:
readability-implicit-bool-conversion.CheckConversionsToBool, value: false},
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/120087
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -357,20 +360,22 @@ void
ImplicitBoolConversionCheck::registerMatchers(MatchFinder *Finder) {
void ImplicitBoolConversionCheck::check(
const MatchFinder::MatchResult &Result) {
-
+ if(CheckConversionsToBool){
PiotrZSL wrote:
Wrong, place these things
https://github.com/PiotrZSL approved this pull request.
https://github.com/llvm/llvm-project/pull/120547
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -259,100 +259,118 @@
ImplicitBoolConversionCheck::ImplicitBoolConversionCheck(
AllowIntegerConditions(Options.get("AllowIntegerConditions", false)),
AllowPointerConditions(Options.get("AllowPointerConditions", false)),
UseUpperCaseLiteralSuffix(
-
https://github.com/PiotrZSL approved this pull request.
Except pointed out findings, looks ok.
https://github.com/llvm/llvm-project/pull/120087
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/120087
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -319,10 +319,16 @@ Changes in existing checks
diagnostic.
- Improved :doc:`readability-implicit-bool-conversion
- ` check
- by adding the option `UseUpperCaseLiteralSuffix` to select the
- case of the literal suffix in fixes and fixing false positive for implicit
- co
@@ -553,6 +555,20 @@ static llvm::IntrusiveRefCntPtr
createBaseFS() {
int clangTidyMain(int argc, const char **argv) {
llvm::InitLLVM X(argc, argv);
+ SmallVector Args{argv, argv + argc};
+
+ llvm::BumpPtrAllocator Alloc;
+ llvm::cl::TokenizerCallback Tokenizer =
+
https://github.com/PiotrZSL closed
https://github.com/llvm/llvm-project/pull/117173
___
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.
Current version looks fine.
Take a look into comments, if something could be improved.
Ping once you finish (looking and/or fixing), so it could be merged.
https://github.com/llvm/llvm-project/pull/116033
__
@@ -183,40 +210,45 @@ void UseStartsEndsWithCheck::check(const
MatchFinder::MatchResult &Result) {
const auto *EndsWithFunction =
Result.Nodes.getNodeAs("ends_with_fun");
assert(bool(StartsWithFunction) != bool(EndsWithFunction));
+
const CXXMethodDecl *Replacemen
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/116033
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -183,40 +210,45 @@ void UseStartsEndsWithCheck::check(const
MatchFinder::MatchResult &Result) {
const auto *EndsWithFunction =
Result.Nodes.getNodeAs("ends_with_fun");
assert(bool(StartsWithFunction) != bool(EndsWithFunction));
+
const CXXMethodDecl *Replacemen
@@ -183,40 +210,45 @@ void UseStartsEndsWithCheck::check(const
MatchFinder::MatchResult &Result) {
const auto *EndsWithFunction =
Result.Nodes.getNodeAs("ends_with_fun");
assert(bool(StartsWithFunction) != bool(EndsWithFunction));
+
const CXXMethodDecl *Replacemen
@@ -265,4 +255,57 @@ void test(std::string s, std::string_view sv, sub_string
ss, sub_sub_string sss,
s.compare(0, 1, "ab") == 0;
s.rfind(suffix, 1) == s.size() - suffix.size();
+
+ #define STR(x) std::string(x)
+ 0 == STR(s).find("a");
+
+ #define STRING s
+ if (0 ==
@@ -7,26 +7,16 @@ Checks for common roundabout ways to express ``starts_with``
and ``ends_with``
and suggests replacing with the simpler method when it is available. Notably,
this will work with ``std::string`` and ``std::string_view``.
-.. code-block:: c++
+The check handle
@@ -183,40 +210,45 @@ void UseStartsEndsWithCheck::check(const
MatchFinder::MatchResult &Result) {
const auto *EndsWithFunction =
Result.Nodes.getNodeAs("ends_with_fun");
assert(bool(StartsWithFunction) != bool(EndsWithFunction));
+
const CXXMethodDecl *Replacemen
https://github.com/PiotrZSL approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/117173
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -42,3 +47,19 @@ void f1() {
// CHECK-MESSAGES-NON-STRICT-REGEX: :[[@LINE-1]]:3: warning: function
'prefix_match_regex' is matched on qualname prefix; it should not be used
// no-warning STRICT-REGEX
}
+
+void f2() {
+ S s;
+
PiotrZSL wrote:
add test w
https://github.com/PiotrZSL requested changes to this pull request.
This isn't good, because "::open" and "std::fstream::open" are 2 different
things.
Please make sure that those 2 can be distinguished (configured to detect only
one or other or both).
https://github.com/llvm/llvm-project/pull
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/117165
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -265,4 +255,57 @@ void test(std::string s, std::string_view sv, sub_string
ss, sub_sub_string sss,
s.compare(0, 1, "ab") == 0;
s.rfind(suffix, 1) == s.size() - suffix.size();
+
+ #define STR(x) std::string(x)
+ 0 == STR(s).find("a");
+
+ #define STRING s
+ if (0 ==
2201 - 2300 of 2524 matches
Mail list logo