@@ -0,0 +1,105 @@
+//===--- IncorrectEnableSharedFromThisCheck.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,33 @@
+.. title:: clang-tidy - bugprone-incorrect-enable-shared-from-this
+
+bugprone-incorrect-enable-shared-from-this
+==
+
+Checks if class/struct publicly inherits from
+``std::enable_shared_from_this``, because otherwise whe
@@ -0,0 +1,105 @@
+//===--- IncorrectEnableSharedFromThisCheck.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/5chmidti edited
https://github.com/llvm/llvm-project/pull/102299
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti closed
https://github.com/llvm/llvm-project/pull/106861
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,34 @@
+// RUN: %check_clang_tidy -std=c++20-or-later %s bugprone-bit-cast-pointers %t
+
+namespace std
+{
+template
+To bit_cast(From from)
+{
+ // Dummy implementation for the purpose of the check.
5chmidti wrote:
nit: `check` -> `test`. `check` is
@@ -0,0 +1,34 @@
+//===--- BitCastPointersCheck.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,40 @@
+.. title:: clang-tidy - bugprone-bit-cast-pointers
+
+bugprone-bit-cast-pointers
+==
+
+Warns about usage of ``std::bit_cast`` when the input and output types are
+pointers.
+
+The motivation is that ``std::bit_cast`` is advertised as the
@@ -0,0 +1,32 @@
+//===--- BitCastPointersCheck.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/5chmidti requested changes to this pull request.
> maintaining the name of the matched classes in a vector and checking for
> every other class if it inherits from `::std::enable_shared_from_this` or
> classes in the vector.
You wouldn't want to save the name, because then y
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/102299
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,34 @@
+.. title:: clang-tidy - bugprone-incorrect-enable-shared-from-this
+
+bugprone-incorrect-enable-shared-from-this
+===
+
+Checks if class/struct publicly derives from ``std::enable_shared_from_this``,
+because otherwise when ``s
@@ -0,0 +1,56 @@
+// RUN: %check_clang_tidy %s bugprone-incorrect-enable-shared-from-this %t --
--
+
+namespace std {
+template class enable_shared_from_this {};
+} //namespace std
+
+class BadClassExample : std::enable_shared_from_this {};
+// CHECK-MESSAGES: :[[@LINE-1]]:7
@@ -53,6 +53,7 @@
#include "ParentVirtualCallCheck.h"
#include "PointerArithmeticOnPolymorphicObjectCheck.h"
#include "PosixReturnCheck.h"
+#include "IncorrectEnableSharedFromThisCheck.h"
5chmidti wrote:
Please sort this include correctly
https://github.com/l
@@ -0,0 +1,33 @@
+//===--- IncorrectEnableSharedFromThisCheck.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/5chmidti requested changes to this pull request.
Please add tests, a release notes entry, and document the option in the
documentation of the check.
https://github.com/llvm/llvm-project/pull/102831
___
cfe-commits mailing list
cfe-c
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/102831
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti commented:
Just small things from me, looking good otherwise
https://github.com/llvm/llvm-project/pull/102831
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
@@ -39,14 +39,22 @@ AST_MATCHER(Stmt, isNULLMacroExpansion) {
}
StringRef getZeroLiteralToCompareWithForType(CastKind CastExprKind,
- QualType Type,
- ASTContext &Context) {
+
@@ -108,6 +108,10 @@ Changes in existing checks
` check to
remove `->`, when reduntant `get()` is removed.
+- Added option `UseUpperCaseSuffix` to
:doc:`readablility-implicit-bool-conversion
+ ` check specify the
+ case of the explicit literal
5chmidti
@@ -36,6 +36,7 @@ class ImplicitBoolConversionCheck : public ClangTidyCheck {
const bool AllowIntegerConditions;
const bool AllowPointerConditions;
+ const bool UseUpperCaseSuffix;
5chmidti wrote:
`UseUpperCaseLiteralSuffix` ?
https://github.com/llvm/ll
@@ -133,3 +133,18 @@ Options
When `true`, the check will allow conditional pointer conversions. Default
is `false`.
+
+.. option:: UseUpperCaseSuffix
+
+ When `true`, the check will allow new explicit conversion use an uppercase
+ suffix when it applies.
---
@@ -36,6 +36,7 @@ class ImplicitBoolConversionCheck : public ClangTidyCheck {
const bool AllowIntegerConditions;
const bool AllowPointerConditions;
+ const bool UseUpperCaseSuffix;
5chmidti wrote:
Yes, the comment is in regard to the option name. My rati
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/91951
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
LGTM minus the stored option value. (please wait for others to finish their
review)
https://github.com/llvm/llvm-project/pull/91951
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:/
@@ -0,0 +1,78 @@
+//===--- PointerArithmeticOnPolymorphicObjectCheck.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
@@ -0,0 +1,49 @@
+//===--- VirtualArithmeticCheck.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
@@ -95,9 +106,59 @@ bool ExprSequence::inSequence(const Stmt *Before, const
Stmt *After) const {
return true;
}
+ SmallVector BeforeParents = getParentStmts(Before, Context);
+
+ // Since C++17, the callee of a call expression is guaranteed to be sequenced
+ // bef
@@ -69,6 +73,30 @@ class UseAfterMoveFinder {
llvm::SmallPtrSet Visited;
};
+/// Returns whether the `Before` block can reach the `After` block.
+bool reaches(const CFGBlock *Before, const CFGBlock *After) {
+ llvm::SmallVector Stack;
+ llvm::SmallPtrSet Visited;
+
+ Stac
@@ -95,9 +106,59 @@ bool ExprSequence::inSequence(const Stmt *Before, const
Stmt *After) const {
return true;
}
+ SmallVector BeforeParents = getParentStmts(Before, Context);
+
+ // Since C++17, the callee of a call expression is guaranteed to be sequenced
+ // bef
@@ -55,12 +55,23 @@ bool isDescendantOrEqual(const Stmt *Descendant, const Stmt
*Ancestor,
ASTContext *Context) {
if (Descendant == Ancestor)
return true;
- for (const Stmt *Parent : getParentStmts(Descendant, Context)) {
-if (isDescendantOr
@@ -175,6 +218,10 @@ bool UseAfterMoveFinder::findInternal(const CFGBlock
*Block,
MovingCall != nullptr &&
Sequence->potentiallyAfter(MovingCall, Use);
+// We default to false here and change this to true if required in
+// find().
+
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/93623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
LGTM after fixing these two comments, but let's wait for others to review as
well
https://github.com/llvm/llvm-project/pull/93623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://l
@@ -110,15 +117,32 @@ bool UseAfterMoveFinder::find(Stmt *CodeBlock, const Expr
*MovingCall,
BlockMap = std::make_unique(TheCFG.get(), Context);
Visited.clear();
- const CFGBlock *Block = BlockMap->blockContainingStmt(MovingCall);
- if (!Block) {
+ const CFGBlock *Move
@@ -35,6 +37,11 @@ struct UseAfterMove {
// Is the order in which the move and the use are evaluated undefined?
bool EvaluationOrderUndefined;
5chmidti wrote:
While you're at it, please initialize `EvaluationOrderUndefined` to `false` as
well.
https://g
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/94524
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/94651
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/94654
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/94512
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/93827
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
5chmidti wrote:
FYI: You could remove the explicit check-nots here:
```c++
// RUN: %check_clang_tidy %s -check-suffixes=,INTERNAL-LINKAGE
cppcoreguidelines-avoid-non-const-global-variables %t
// RUN: %check_clang_tidy %s cppcoreguidelines-avoid-non-const-globa
https://github.com/5chmidti approved this pull request.
While I'm leaning more towards
> NOLINT in the code can grab the attention of a future developer and prompt a
> refactoring to avoid the pattern.
, it's an off-by-default option that provides a choice.
LGTM
https://github.com/llvm/llvm-
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?=
Message-ID:
In-Reply-
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?=
Message-ID:
In-Reply-
=��___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?=
Message-ID:
In-Reply-
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?=
Message-ID:
In-Reply-
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?=
Message-ID:
In-Reply-
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?=
Message-ID:
In-Reply-
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?=
Message-ID:
In-Reply-
https://github.com/5chmidti commented:
The execution time of clang-tidy is a nice improvement as well.
---
> What OS/Python version does this occur on?
|OS|Python|Noisy Shutdown|
|-|-|-|
|Manjaro|3.11.9|Yes|
|NixOS|3.9.19|No|
|NixOS|3.10.14|No|
|NixOS|3.11.9|No|
|Manjaro|3.12.3|Yes|
|Manjaro|3
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/89490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -501,70 +506,72 @@ def main():
# Build up a big regexy filter from all command line arguments.
file_name_re = re.compile("|".join(args.files))
+files = {f for f in files if file_name_re.search(f)}
-return_code = 0
+returncode = 0
try:
-# S
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/89490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,83 @@
+.. title:: clang-tidy - bugprone-exception-rethrow
+
+bugprone-exception-rethrow
+==
+
+Identifies problematic exception rethrowing, especially with caught exception
+variables or empty throw statements outside catch blocks.
+
+In C++ exce
@@ -0,0 +1,67 @@
+//===--- ExceptionRethrowCheck.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
@@ -0,0 +1,84 @@
+.. title:: clang-tidy - bugprone-exception-rethrow
+
+bugprone-exception-rethrow
+==
+
+Identifies problematic exception rethrowing, especially with caught exception
+variables or empty throw statements outside catch blocks.
+
+In C++ exce
@@ -0,0 +1,67 @@
+//===--- ExceptionRethrowCheck.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/5chmidti commented:
@neoncube2 do you plan to continue working on this?
---
Because we are emitting a fix-it, it might be a good idea to check if the
return type of `c_str` is that of `data` (~possibly unwrapping aliases).
https://github.com/llvm/llvm-project/pull/71304
___
@@ -40,8 +40,10 @@ void ContainerDataPointerCheck::registerMatchers(MatchFinder
*Finder) {
cxxRecordDecl(
unless(matchers::matchesAnyListedName(IgnoredContainers)),
isSameOrDerivedFrom(
- namedDecl(
- has(cxxMethodDecl(is
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/71304
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -111,16 +115,18 @@ void ContainerDataPointerCheck::check(const
MatchFinder::MatchResult &Result) {
MemberExpr>(CE))
ReplacementText = "(" + ReplacementText + ")";
- if (CE->getType()->isPointerType())
-ReplacementText += "->data()";
- else
-Replace
@@ -0,0 +1,67 @@
+//===--- ExceptionRethrowCheck.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/5chmidti edited
https://github.com/llvm/llvm-project/pull/95667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -387,3 +387,38 @@ void foo(const StructWithFieldContainer &Src) {
B.push_back(Number);
}
}
+
+namespace gh95596 {
+
+void f(std::vector& t) {
+ {
+std::vector gh95596_0;
+// CHECK-FIXES: gh95596_0.reserve(10);
+for (unsigned i = 0; i < 10; ++i)
+ gh95
https://github.com/5chmidti approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/95667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/95667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/89490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/96122
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti commented:
´run-clang-tidy.py` and `clang-tidy-diff.py` should probably expose an option
to enable this option via the script (maybe with an adjustment to the release
notes).
https://github.com/llvm/llvm-project/pull/96122
___
@@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) {
return 0;
}
- if (EnabledChecks.empty()) {
+ if (EnabledChecks.empty() && !AllowNoChecks) {
llvm::errs() << "Error: no checks enabled.\n";
llvm::cl::PrintHelpMessage(/*Hidden=*/false, /*Cate
https://github.com/5chmidti approved this pull request.
> I'm not 100% sure about release-notes entry. If it shouldn't say that check
> is restricted now to zero-argument size/length.
I'd use the release note as it is. Or what is your concern with it?
https://github.com/llvm/llvm-project/pull/
@@ -0,0 +1,49 @@
+//===--- VirtualArithmeticCheck.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
@@ -0,0 +1,49 @@
+//===--- VirtualArithmeticCheck.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
@@ -1071,7 +1071,7 @@ bool IdentifierNamingCheck::isParamInMainLikeFunction(
if (!IsIntType(FDecl->parameters()[0]->getType()))
return false;
MainType Type = IsCharPtrPtr(FDecl->parameters()[1]->getType());
- if (Type == None)
+ if (Type is None)
5chm
https://github.com/5chmidti created
https://github.com/llvm/llvm-project/pull/94243
Adds a def file to have a single location where tested language versions are
specified. Removes the need to update multiple locations in the testing
infrastructure to add a new language version to be tested. Te
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/94243
>From 1c6f2a0a2780d3189e1cfe2a0f4ac9c3a33fcf8d Mon Sep 17 00:00:00 2001
From: Julian Schmidt
Date: Sat, 1 Jun 2024 17:38:37 +0200
Subject: [PATCH] [clang][test] add TestLanguage.def to specify all tested
langua
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/94243
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -125,25 +123,42 @@ llvm::Error ScopifyEnum::addClassKeywordToDeclarations() {
}
llvm::Error ScopifyEnum::scopifyEnumValues() {
- std::string PrefixToInsert(D->getName());
- PrefixToInsert += "::";
+ StringRef EnumName(D->getName());
+ bool StripPrefix = true;
+ for (au
@@ -125,25 +123,42 @@ llvm::Error ScopifyEnum::addClassKeywordToDeclarations() {
}
llvm::Error ScopifyEnum::scopifyEnumValues() {
- std::string PrefixToInsert(D->getName());
- PrefixToInsert += "::";
+ StringRef EnumName(D->getName());
+ bool StripPrefix = true;
+ for (au
https://github.com/5chmidti commented:
I think this change could use a release note in the docs, could you please add
one?
https://github.com/llvm/llvm-project/pull/83412
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/c
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/83412
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti created
https://github.com/llvm/llvm-project/pull/88737
Clangd already implements some utility functions for converting between
SourceLocations, Positions and Offsets into a buffer.
>From 3ee0dfe6292146d188f7d14f717c1e989c668e1c Mon Sep 17 00:00:00 2001
From: Julian
5chmidti wrote:
@ckandeler while opening up your other changes in my editor, I wanted to see if
some of the logic around `Position`s and `Offset`s could be simplified. It
looks like `clangd` already implements some of the functionality in the
`SourceCode.h` file. This shouldn't actually change
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/75533
>From b8f3f364310ca6094a6944f4f3ee9349c8aa77d6 Mon Sep 17 00:00:00 2001
From: Julian Schmidt <44101708+5chmi...@users.noreply.github.com>
Date: Sat, 21 Jan 2023 14:49:58 +0100
Subject: [PATCH 1/3] [clangd] Extrac
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/88737
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -151,6 +151,10 @@ Changes in existing checks
` check to ignore code
within unevaluated contexts, such as ``decltype``.
+- Improved :doc:`bugprone-lambda-function-name
+ ` check by ignoring
+ ``__func__`` macro in lambda captures and nested function declaration.
--
@@ -69,9 +73,13 @@ void
LambdaFunctionNameCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
}
void LambdaFunctionNameCheck::registerMatchers(MatchFinder *Finder) {
- // Match on PredefinedExprs inside a lambda.
- Finder->addMatcher(predefinedExpr(hasAncestor(lambdaEx
5chmidti wrote:
I let it run for a few minutes and didn't observe any crashes (on a release
build though). However, I did find an issue with macros:
```c++
int sink(int);
#define FUN(ARG) (sink(ARG))
#define FUN2(ARG) sink((ARG))
#define FUN3(ARG) sink(ARG)
void f() {
...
//CHECK-MESSA
https://github.com/5chmidti created
https://github.com/llvm/llvm-project/pull/89392
In the added testcase, which is invalid code, the result of `getDecl()` called
on a `TemplateTypeParmTypeLoc` was
a `nullptr`. However, `IndexingContext::handleReference` expects the parameter
`D` to not be a `
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/89392
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
5chmidti wrote:
CC @hokein
https://github.com/llvm/llvm-project/pull/89392
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/89076
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti requested changes to this pull request.
I started taking a look at this and realized you switched up which argument
matcher needs the extra `ignoringParenImpCasts`, so that it can be removed from
the matcher definition.
See
https://github.com/llvm/llvm-project/blob
@@ -74,8 +74,9 @@ RewriteRuleWith StringviewNullptrCheckImpl() {
auto BasicStringViewConstructingFromNullExpr =
cxxConstructExpr(
HasBasicStringViewType, argumentCountIs(1),
- hasAnyArgument(/* `hasArgument` would skip over parens */ anyOf(
-
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/89509
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -90,8 +91,9 @@ RewriteRuleWith StringviewNullptrCheckImpl() {
auto HandleTemporaryCXXTemporaryObjectExprAndCompoundLiteralExpr = makeRule(
cxxTemporaryObjectExpr(cxxConstructExpr(
HasBasicStringViewType, argumentCountIs(1),
- hasAnyArgument(/* `has
@@ -0,0 +1,35 @@
+//===--- ReturnConstRefFromParameterCheck.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
401 - 500 of 1291 matches
Mail list logo