@@ -64,16 +64,21 @@ AST_MATCHER(CXXRecordDecl, correctHandleCaptureThisLambda) {
constexpr const char *DefaultFunctionWrapperTypes =
"::std::function;::std::move_only_function;::boost::function";
+constexpr const char *DefaultBindFunctions = "::std::bind;::boost::bind";
--
denzor200 wrote:
LGTM, please provide the change for one comment I left
https://github.com/llvm/llvm-project/pull/130297
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,36 @@
+.. title:: clang-tidy - bugprone-capturing-this-in-member-variable
+
+bugprone-capturing-this-in-member-variable
+==
+
+Finds lambda captures that capture the ``this`` pointer and store it as class
+members without handle t
@@ -0,0 +1,36 @@
+.. title:: clang-tidy - bugprone-capturing-this-in-member-variable
+
+bugprone-capturing-this-in-member-variable
+==
+
+Finds lambda captures that capture the ``this`` pointer and store it as class
+members without handle t
https://github.com/denzor200 approved this pull request.
https://github.com/llvm/llvm-project/pull/130297
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,144 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s
bugprone-capturing-this-by-field %t -- -config="{CheckOptions:
{bugprone-capturing-this-by-field.FunctionWrapperTypes:
'::std::function;::Fn'}}" --
denzor200 wrote:
Created issues about bind a
https://github.com/denzor200 edited
https://github.com/llvm/llvm-project/pull/130297
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,44 @@
+//===--- CapturingThisByFieldCheck.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,144 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s
bugprone-capturing-this-by-field %t -- -config="{CheckOptions:
{bugprone-capturing-this-by-field.FunctionWrapperTypes:
'::std::function;::Fn'}}" --
denzor200 wrote:
Oke, don't worry about bind
@@ -0,0 +1,44 @@
+//===--- CapturingThisByFieldCheck.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/denzor200 edited
https://github.com/llvm/llvm-project/pull/130297
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,144 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s
bugprone-capturing-this-by-field %t -- -config="{CheckOptions:
{bugprone-capturing-this-by-field.FunctionWrapperTypes:
'::std::function;::Fn'}}" --
+
+namespace std {
+
+template
+class function;
+
+template
+c
@@ -0,0 +1,144 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s
bugprone-capturing-this-by-field %t -- -config="{CheckOptions:
{bugprone-capturing-this-by-field.FunctionWrapperTypes:
'::std::function;::Fn'}}" --
+
+namespace std {
+
+template
+class function;
+
+template
+c
https://github.com/denzor200 requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/130297
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -118,6 +119,8 @@ class BugproneModule : public ClangTidyModule {
CheckFactories.registerCheck(
"bugprone-bool-pointer-implicit-conversion");
CheckFactories.registerCheck("bugprone-branch-clone");
+CheckFactories.registerCheck(
+"bugprone-capture-t
@@ -0,0 +1,99 @@
+//===--- CaptureThisByFieldCheck.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: Apa
https://github.com/denzor200 approved this pull request.
https://github.com/llvm/llvm-project/pull/121291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,130 @@
+//===--- AmbiguousSmartptrResetCallCheck.cpp - clang-tidy
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
https://github.com/denzor200 requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/121291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,130 @@
+//===--- AmbiguousSmartptrResetCallCheck.cpp - clang-tidy
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,131 @@
+//===--- AmbiguousSmartptrResetCallCheck.cpp - clang-tidy
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
https://github.com/denzor200 requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/121291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,48 @@
+.. title:: clang-tidy - readability-ambiguous-smartptr-reset-call
+
+readability-ambiguous-smartptr-reset-call
+=
+
+Finds potentially erroneous calls to ``reset`` method on smart pointers when
+the pointee type also has a
denzor200 wrote:
> Wouldn't that be a runtime check, and thus not something clang-tidy can do
> without significant data flow analysis effort?
I'm not experienced enough in clang-tidy internals, but I believe it will not
be a serious challenge to check for having `assert(sp.use_count() == 1)`
@@ -0,0 +1,34 @@
+//===--- SmartptrResetAmbiguousCallCheck.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
denzor200 wrote:
Suppose this check should be silent for a shared_ptr with `use_count() == 1`.
Is it possible to change implementation in order to following this way?
https://github.com/llvm/llvm-project/pull/67467
___
cfe-commits mailing list
cfe-com
@@ -0,0 +1,149 @@
+// RUN: %check_clang_tidy -std=c++20 %s readability-use-span-first-last %t
+
+namespace std {
+template
+class span {
+ T* ptr;
+ __SIZE_TYPE__ len;
+
+public:
+ span(T* p, __SIZE_TYPE__ l) : ptr(p), len(l) {}
+
+ span subspan(__SIZE_TYPE__ offset) const
@@ -0,0 +1,108 @@
+// RUN: %check_clang_tidy %s readability-stringview-substr %t
+
+namespace std {
+template
+class basic_string_view {
+public:
+ using size_type = unsigned long;
+ static constexpr size_type npos = -1;
+
+ basic_string_view(const char*) {}
+ basic_string_vi
@@ -0,0 +1,108 @@
+// RUN: %check_clang_tidy %s readability-stringview-substr %t
+
+namespace std {
+template
+class basic_string_view {
+public:
+ using size_type = unsigned long;
+ static constexpr size_type npos = -1;
+
+ basic_string_view(const char*) {}
+ basic_string_vi
@@ -0,0 +1,103 @@
+// RUN: %check_clang_tidy %s bugprone-exception-rethrow %t -- -- -fexceptions
+
+struct exception {};
+
+namespace std {
+ template
+ T&& move(T &&x) {
+return static_cast(x);
+ }
+}
+
+void correct() {
+ try {
+ throw exception();
+ } catch(const
30 matches
Mail list logo