[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-05-19 Thread St. Muench via cfe-commits
https://github.com/stmuench edited https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-05-15 Thread St. Muench via cfe-commits
stmuench wrote: @vbvictor since is there no further activity by reviewers here, any idea on how to continue with this PR? https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-05-06 Thread St. Muench via cfe-commits
stmuench wrote: @PiotrZSL would have any further remarks for this PR? https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-05-06 Thread St. Muench via cfe-commits
https://github.com/stmuench updated https://github.com/llvm/llvm-project/pull/132924 Rate limit ยท GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-05-06 Thread St. Muench via cfe-commits
@@ -39,6 +39,29 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +AST_MATCHER(clang::TypeLoc, isInImplicitTemplateInstantiation) { + const auto IsImplicitTemplateInstantiation = [](const auto *Node) { +return (Node != nullptr) && +

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-05-06 Thread St. Muench via cfe-commits
@@ -39,6 +39,29 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +AST_MATCHER(clang::TypeLoc, isInImplicitTemplateInstantiation) { + const auto IsImplicitTemplateInstantiation = [](const auto *Node) { +return (Node != nullptr) && +

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-30 Thread St. Muench via cfe-commits
https://github.com/stmuench edited https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-30 Thread St. Muench via cfe-commits
@@ -39,6 +39,30 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +bool isWithinImplicitTemplateInstantiation(const TypeLoc *MatchedTypeLoc, stmuench wrote: Precisely, there were no template types so far in the existing

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-30 Thread St. Muench via cfe-commits
stmuench wrote: > Please add release notes in this patch. I think the idea is good, but you can > look into my review after PiotrZSL's comments. @vbvictor many thanks for your very valuable comments. I incorporated them as far as possible. https://github.com/llvm/llvm-project/pull/132924

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-30 Thread St. Muench via cfe-commits
https://github.com/stmuench updated https://github.com/llvm/llvm-project/pull/132924 >From fb9f0c3db8609645588692eecc294407f48c1c34 Mon Sep 17 00:00:00 2001 From: stmuench Date: Tue, 25 Mar 2025 12:38:53 +0100 Subject: [PATCH] [clang-tidy] do not diagn. array types in implicit templ. instantia

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-30 Thread St. Muench via cfe-commits
@@ -39,6 +39,30 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +bool isWithinImplicitTemplateInstantiation(const TypeLoc *MatchedTypeLoc, stmuench wrote: > Could you please elaborate what is this function for? I delet

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-30 Thread St. Muench via cfe-commits
@@ -39,6 +39,30 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +bool isWithinImplicitTemplateInstantiation(const TypeLoc *MatchedTypeLoc, stmuench wrote: I tried to implement it this way at first but unfortunately the

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-28 Thread St. Muench via cfe-commits
stmuench wrote: @PiotrZSL if it suits your convenience, could you maybe have a look at this PR? Many thanks in advance. https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-28 Thread St. Muench via cfe-commits
@@ -92,3 +92,162 @@ const char name[] = "Some string"; void takeCharArray(const char name[]); // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: do not declare C-style arrays, use 'std::array' or 'std::vector' instead [modernize-avoid-c-arrays] + +namespace std { + template + str

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-28 Thread St. Muench via cfe-commits
https://github.com/stmuench updated https://github.com/llvm/llvm-project/pull/132924 >From 7f621bc7e169cf34d95ba34b0895c9fa75adb712 Mon Sep 17 00:00:00 2001 From: stmuench Date: Tue, 25 Mar 2025 12:38:53 +0100 Subject: [PATCH] [clang-tidy] do not diagn. array types in implicit templ. instantia

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-25 Thread St. Muench via cfe-commits
@@ -92,3 +92,162 @@ const char name[] = "Some string"; void takeCharArray(const char name[]); // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: do not declare C-style arrays, use 'std::array' or 'std::vector' instead [modernize-avoid-c-arrays] + +namespace std { + template + str

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-25 Thread St. Muench via cfe-commits
https://github.com/stmuench updated https://github.com/llvm/llvm-project/pull/132924 >From 29cfb29e064abf21c01a60aca380a58a4e5adb69 Mon Sep 17 00:00:00 2001 From: stmuench Date: Tue, 25 Mar 2025 12:38:53 +0100 Subject: [PATCH] [clang-tidy] do not diagn. array types in implicit templ. instantia

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-07 Thread St. Muench via cfe-commits
https://github.com/stmuench edited https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-05 Thread St. Muench via cfe-commits
https://github.com/stmuench updated https://github.com/llvm/llvm-project/pull/132924 >From 823475c91f9cdf64c816e9498a42f5ee9b2080be Mon Sep 17 00:00:00 2001 From: stmuench Date: Tue, 25 Mar 2025 12:38:53 +0100 Subject: [PATCH] [clang-tidy] do not diagn. array types in implicit templ. instantia

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-03 Thread St. Muench via cfe-commits
stmuench wrote: Ping https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-03-27 Thread St. Muench via cfe-commits
@@ -92,3 +92,162 @@ const char name[] = "Some string"; void takeCharArray(const char name[]); // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: do not declare C-style arrays, use 'std::array' or 'std::vector' instead [modernize-avoid-c-arrays] + +namespace std { + template + str

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-03-26 Thread St. Muench via cfe-commits
https://github.com/stmuench edited https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-03-26 Thread St. Muench via cfe-commits
@@ -92,3 +92,162 @@ const char name[] = "Some string"; void takeCharArray(const char name[]); // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: do not declare C-style arrays, use 'std::array' or 'std::vector' instead [modernize-avoid-c-arrays] + +namespace std { + template + str

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-03-25 Thread St. Muench via cfe-commits
https://github.com/stmuench updated https://github.com/llvm/llvm-project/pull/132924 >From 8b720d23c2c2252a709d9fd94a2f2fffe8d3fd87 Mon Sep 17 00:00:00 2001 From: stmuench Date: Tue, 25 Mar 2025 12:38:53 +0100 Subject: [PATCH] [clang-tidy] do not diagn. array types in implicit templ. instantia

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-03-25 Thread St. Muench via cfe-commits
https://github.com/stmuench ready_for_review https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] offer option to check sugared types in avoid-c-arrays check (PR #131468)

2025-03-25 Thread St. Muench via cfe-commits
stmuench wrote: > Example: > > ``` > #include > > template > void f(T &&value) {} > > void test() { > int t[10]; > f(t); > } > ``` > > ``` > /root/1.cpp:3:50: warning: do not declare C-style arrays, use 'std::array' > instead > [cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,mod

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-03-25 Thread St. Muench via cfe-commits
https://github.com/stmuench created https://github.com/llvm/llvm-project/pull/132924 So far, the clang-tidy check `modernize-avoid-c-arrays` also diagnosed array types for type template parameters even though no actual array type got written there but it got deduced to one. In such case, there