https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/93217
___
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, with a release note nit.
https://github.com/llvm/llvm-project/pull/93217
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -387,6 +387,11 @@ Changes in existing checks
` check to properly
emit warnings for static data member with an in-class initializer.
+- Improved :doc:`readability-redundant-member-init
+ ` check to avoid
+ false-positives when type of the member does not match type of
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
@@ -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 commented:
Thanks for the cleanup, it looks overall good (w.r.t `asyncio`: I only know
about `asyncio` what I read in this pr).
> Only print the filename after completion, not the entire Clang-Tidy
> invocation command. I find this neater but the behavior can easily
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/93467
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/94243
>From 1ef1bc0bfebca8ca114a57ea2d5016418e36446d Mon Sep 17 00:00:00 2001
From: Julian Schmidt
Date: Sat, 1 Jun 2024 17:38:37 +0200
Subject: [PATCH 1/3] [clang][test] add TestLanguage.def to specify all tested
la
5chmidti wrote:
rebase + ping. @AaronBallman could you check if this is okay now? I could merge
the AST matcher doc testing stack if that is the case
https://github.com/llvm/llvm-project/pull/94243
___
cfe-commits mailing list
cfe-commits@lists.llvm.o
@@ -108,6 +108,11 @@ Changes in existing checks
` check to
remove `->`, when reduntant `get()` is removed.
+- Improved :doc:`readablility-implicit-bool-conversion
5chmidti wrote:
Please sort your entry before `readability-redundant-smartptr-get`
https://
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/104882
___
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 but with two nits
https://github.com/llvm/llvm-project/pull/104882
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -392,8 +402,16 @@ void ImplicitBoolConversionCheck::handleCastFromBool(
if (const auto *BoolLiteral =
dyn_cast(Cast->getSubExpr()->IgnoreParens())) {
-Diag << tooling::fixit::createReplacement(
-*Cast, getEquivalentForBoolLiteral(BoolLiteral, DestTyp
https://github.com/5chmidti requested changes to this pull request.
This is still missing a release note, see
https://github.com/llvm/llvm-project/blob/40975da950c95124155b752cd683d945f7d203fd/clang-tools-extra/docs/ReleaseNotes.rst?plain=1#L104
for where to add it and how they look like
Funct
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/100349
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -638,6 +638,39 @@ bool HasNameMatcher::matchesNodeFullFast(const NamedDecl
&Node) const {
return Patterns.foundMatch(/*AllowFullyQualified=*/true);
}
+static std::optional consumePatternBack(StringRef Pattern,
+ StringRef
@@ -638,6 +638,39 @@ bool HasNameMatcher::matchesNodeFullFast(const NamedDecl
&Node) const {
return Patterns.foundMatch(/*AllowFullyQualified=*/true);
}
+static std::optional consumePatternBack(StringRef Pattern,
+ StringRef
@@ -638,6 +638,39 @@ bool HasNameMatcher::matchesNodeFullFast(const NamedDecl
&Node) const {
return Patterns.foundMatch(/*AllowFullyQualified=*/true);
}
+static std::optional consumePatternBack(StringRef Pattern,
+ StringRef
https://github.com/5chmidti requested changes to this pull request.
I think it does make sense to add this wildcard. The motivation to skip regex
sounds like a good one, and it does make sense to special case templates
specifically. The implementation looks correct to me. Just some small things
@@ -653,10 +686,12 @@ bool HasNameMatcher::matchesNodeFullSlow(const NamedDecl
&Node) const {
for (const StringRef Pattern : Names) {
if (Pattern.starts_with("::")) {
-if (FullName == Pattern)
+if (auto Result = consumePatternBack(Pattern, FullName);
5chmidti wrote:
> for me oryginal version that used registerMatchers instead of visitor were
> way better, specially that there are matchers that could be used for this, or
> could be written.
We do have the `isDerivedFrom` matcher, actually.
> in most projects not many classes actually used
@@ -24,3 +24,7 @@
// TODO(b/12345): find the holy grail
// TODO (b/12345): allow spaces before parentheses
// TODO(asdf) allow missing semicolon
+// TODO: bug 12345678 - Remove this after the 2047q4 compatibility window
expires.
+// TODO: example.com/my-design-doc - Manually f
@@ -9,6 +9,7 @@
#include "TodoCommentCheck.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/Preprocessor.h"
+#include
5chmidti wrote:
Please remove this unused include
https://github.com/llvm/llvm-project/pull/104868
__
@@ -116,6 +116,10 @@ Changes in existing checks
` check to
remove `->`, when redundant `get()` is removed.
+- Fixed :doc:`cppcoreguidelines-pro-type-union-access
+ ` check to
+ report location even when member location is not valid.
5chmidti wrote:
nit:
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/104540
___
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/95235
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti commented:
>From a functionality standpoint, this looks good to me. I noted some small
>things in the code, and this is also missing a release not entry.
https://github.com/llvm/llvm-project/pull/95235
___
cfe-commits maili
@@ -212,9 +232,13 @@ getFunctionSourceCode(const FunctionDecl *FD, const
DeclContext *TargetContext,
}
}
const NamedDecl *ND = Ref.Targets.front();
-const std::string Qualifier =
+std::string Qualifier =
getQualification(A
@@ -407,10 +431,21 @@ class DefineOutline : public Tweak {
return !SameFile;
}
-// Bail out in templated classes, as it is hard to spell the class name,
-// i.e if the template parameter is unnamed.
-if (MD->getParent()->isTemplated())
- return false
@@ -407,10 +431,21 @@ class DefineOutline : public Tweak {
return !SameFile;
}
-// Bail out in templated classes, as it is hard to spell the class name,
-// i.e if the template parameter is unnamed.
-if (MD->getParent()->isTemplated())
- return false
@@ -144,8 +144,13 @@ getQualification(ASTContext &Context, const DeclContext
*DestContext,
// since we stored inner-most parent first.
std::string Result;
llvm::raw_string_ostream OS(Result);
- for (const auto *Parent : llvm::reverse(Parents))
+ for (const auto *Parent
@@ -128,7 +128,27 @@ getFunctionSourceAfterReplacements(const FunctionDecl *FD,
SM.getBufferData(SM.getMainFileID()), Replacements);
if (!QualifiedFunc)
return QualifiedFunc.takeError();
- return QualifiedFunc->substr(FuncBegin, FuncEnd - FuncBegin + 1);
+
+ std::
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/95235
___
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.
Because the commit with asyncio is in llvm-19, could you please add a release
note for this fix?
@PiotrZSL wdyt about backporting this? 19.1.0 may be too late, but for 19.2.0
then
https://github.com/llvm/llvm-project/pull/105724
@@ -0,0 +1,5 @@
+// RUN: not clang-tidy %s -checks='-*'
+// RUN: clang-tidy %s -checks='-*' --allow-no-checks | FileCheck
--match-full-lines %s
+
+
+// CHECK: No checks enabled.
5chmidti wrote:
missing newline
https://github.com/llvm/llvm-project/pull/96122
___
5chmidti wrote:
the same should probably be done for `diff-clang-tidy.py`
https://github.com/llvm/llvm-project/pull/96122
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
5chmidti wrote:
The other two functions have fixes as well. I'd argue that template
declarations don't need to be inside anonymous namespaces/`static`, but that's
outside the scope of this pr.
Either way, this pr should check that both have an attached fixit:
@@ -82,11 +82,19 @@ static constexpr StringRef Message =
void UseInternalLinkageCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *FD = Result.Nodes.getNodeAs("fn")) {
-diag(FD->getLocation(), Message) << "function" << FD;
+DiagnosticBuilder DB =
https://github.com/5chmidti commented:
When you add a `.` to make the help messages sentences, then you might want to
capitalize the first word as well.
https://github.com/llvm/llvm-project/pull/96199
___
cfe-commits mailing list
cfe-commits@lists.llv
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
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
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
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
=��___
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
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
=��___
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
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
@@ -0,0 +1,81 @@
+//===--- 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
5chmidti wrote:
No worries. Feel free to ask in reviews or in discord though. Feel free to
close it if you don't want to work on this anymore. The pr will still be linked
in the issue, in case someone wants to look at it.
https://github.com/llvm/llvm-project/pull/71304
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/86448
___
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/96122
___
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/96199
___
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 from my side
https://github.com/llvm/llvm-project/pull/96203
___
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/96203
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -25,3 +25,16 @@ Example:
}
// already declared as extern
extern int v2;
+
+Options
+---
+
+.. option:: FixMode
+
+ Selects the fix mode when fixing automatically.
5chmidti wrote:
Not sure if it is better: `Selects what kind of a fix the check sho
@@ -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
@@ -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 closed
https://github.com/llvm/llvm-project/pull/107850
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -46,14 +46,15 @@ void AvoidEndlCheck::check(const MatchFinder::MatchResult
&Result) {
// Handle the more common streaming '... << std::endl' case
const CharSourceRange TokenRange =
CharSourceRange::getTokenRange(Expression->getSourceRange());
-const Stri
@@ -120,6 +120,10 @@ Changes in existing checks
` check to support replacing
member function calls too.
+- Improved :doc:`performance-avoid-endl
+ ` check by fixing incorrect
+ message.
+
5chmidti wrote:
This feels a bit terse to me. (possible change wo
@@ -0,0 +1,95 @@
+//===--- 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: Apa
@@ -0,0 +1,95 @@
+//===--- 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: Apa
@@ -0,0 +1,95 @@
+//===--- 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: Apa
@@ -0,0 +1,35 @@
+//===--- 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
5chmidti wrote:
Please add tests with macros involved.
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-commi
@@ -0,0 +1,95 @@
+//===--- 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: Apa
@@ -0,0 +1,121 @@
+// RUN: %check_clang_tidy -std=c++11 %s
bugprone-incorrect-enable-shared-from-this %t
+
+// NOLINTBEGIN
+namespace std {
+template class enable_shared_from_this {};
+} //namespace std
+// NOLINTEND
+
+class BadClassExample : std::enable_shared_from_this {}
@@ -0,0 +1,95 @@
+//===--- 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: Apa
@@ -0,0 +1,95 @@
+//===--- 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: Apa
https://github.com/5chmidti approved this pull request.
This looks good from my side.
https://github.com/llvm/llvm-project/pull/106350
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -127,57 +134,137 @@ static bool isAnnexKAvailable(std::optional
&CacheVar, Preprocessor *PP,
return CacheVar.value();
}
+static std::vector
+parseCheckedFunctions(StringRef Option, ClangTidyContext *Context) {
+ const std::vector Functions =
+ utils::options::parse
@@ -127,57 +134,137 @@ static bool isAnnexKAvailable(std::optional
&CacheVar, Preprocessor *PP,
return CacheVar.value();
}
+static std::vector
+parseCheckedFunctions(StringRef Option, ClangTidyContext *Context) {
+ const std::vector Functions =
+ utils::options::parse
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/106350
___
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.
FYI: this is a partial fix of #75685
https://github.com/llvm/llvm-project/pull/107711
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/107867
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -123,6 +123,10 @@ Changes in existing checks
` check to support replacing
member function calls too.
+- Improved :doc:`performance-avoid-endl
+ ` check to use ``std::endl`` as
+ placeholder when lexer cannot get source text.
5chmidti wrote:
Sounds be
https://github.com/5chmidti approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/107867
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -38,6 +39,13 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) {
return FD ? FD->isMain() : false;
}
+AST_MATCHER_P(clang::TypeLoc, alwaysTrue,
+ clang::ast_matchers::internal::Matcher,
+ InnerMatcher) {
+ InnerMatcher.matches(Node, Finder, Build
@@ -1,9 +1,9 @@
-// RUN: %check_clang_tidy %s modernize-avoid-c-arrays %t -- \
+// RUN: %check_clang_tidy -std=c++17 %s modernize-avoid-c-arrays %t -- \
// RUN: -config='{CheckOptions: { modernize-avoid-c-arrays.AllowStringArrays:
true }}'
const char name[] = "name";
const
@@ -111,6 +111,10 @@ Changes in existing checks
` check to suggest replacing
the offending code with ``reinterpret_cast``, to more clearly express intent.
+- Improved :doc:`modernize-avoid-c-arrays
+ ` check to suggest use std::span
+ as replacement of c array in C++20.
@@ -72,11 +81,24 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder
*Finder) {
void AvoidCArraysCheck::check(const MatchFinder::MatchResult &Result) {
const auto *ArrayType = Result.Nodes.getNodeAs("typeloc");
-
+ const bool IsInParam =
+ Result.Nodes.getNodeAs("
https://github.com/5chmidti closed
https://github.com/llvm/llvm-project/pull/107641
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,38 @@
+//===-- SwapBinaryOperandsTests.cpp -*- 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,210 @@
+//===--- SwapBinaryOperands.cpp --*-
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: Ap
@@ -0,0 +1,210 @@
+//===--- SwapBinaryOperands.cpp --*-
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: Ap
https://github.com/5chmidti commented:
Could you add a release note for this as well?
https://github.com/llvm/llvm-project/pull/78999
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,210 @@
+//===--- SwapBinaryOperands.cpp --*-
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: Ap
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/78999
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,210 @@
+//===--- SwapBinaryOperands.cpp --*-
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: Ap
@@ -0,0 +1,210 @@
+//===--- SwapBinaryOperands.cpp --*-
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: Ap
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/78999
___
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/78999
___
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/78999
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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
@@ -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
@@ -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
@@ -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
701 - 800 of 1291 matches
Mail list logo