[clang-tools-extra] [clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression (PR #139474)

2025-07-13 Thread via cfe-commits
AndreyG wrote: Done. I've added tests for `short` and `int` and the same for C++. Also I noticed that in `trunk` there is the same issue in C++ for `short` (but not for `char`): https://github.com/llvm/llvm-project/issues/139467#issuecomment-3068027828. In m

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ void UseEmplaceCheck::check(const MatchFinder::MatchResult &Result) { }(); assert(Call && "No call matched"); - assert((CtorCall || MakeCall) && "No push_back parameter matched"); + assert((CtorCall || MakeCall || AggInitCall) && + "No push

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ void UseEmplaceCheck::check(const MatchFinder::MatchResult &Result) { }(); assert(Call && "No call matched"); - assert((CtorCall || MakeCall) && "No push_back parameter matched"); + assert((CtorCall || MakeCall || AggInitCall) && + "No push

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ void UseEmplaceCheck::check(const MatchFinder::MatchResult &Result) { }(); assert(Call && "No call matched"); - assert((CtorCall || MakeCall) && "No push_back parameter matched"); + assert((CtorCall || MakeCall || AggInitCall) && + "No push

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { + +void CXX20testBracedInitTemporaries(){ + --

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { + +void CXX20testBracedInitTemporaries(){

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { + +void CXX20testBracedInitTemporaries(){ + + std::vector

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1434,3 +1436,33 @@ void testWithPointerTypes() { // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: unnecessary temporary object created while calling emplace // CHECK-FIXES: sp->emplace(); } + +namespace GH1225740 { vbvictor wrote: nit: After N years this

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,12 @@ -// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \ +// RUN: %check_clang_tidy %s -std=c++11 modernize-use-emplace %t -- \ vbvictor wrote: ```suggestion // RUN: %check_clang_tidy %s -std=c++11,c++14,c++17 modernize-use-emplace %t -- \ ``

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -1,4 +1,12 @@ -// RUN: %check_clang_tidy %s modernize-use-emplace %t -- \ +// RUN: %check_clang_tidy %s -std=c++11 modernize-use-emplace %t -- \ +// RUN: -config="{CheckOptions: \ +// RUN: {modernize-use-emplace.ContainersWithPushBack: \ +// RUN:':

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -332,19 +376,42 @@ void UseEmplaceCheck::check(const MatchFinder::MatchResult &Result) { }(); assert(Call && "No call matched"); - assert((CtorCall || MakeCall) && "No push_back parameter matched"); + assert((CtorCall || MakeCall || AggInitCall) && + "No push

[clang-tools-extra] [clang-tidy] fix `bugprone-narrowing-conversions` false positive for conditional expression (PR #139474)

2025-07-13 Thread via cfe-commits
https://github.com/AndreyG updated https://github.com/llvm/llvm-project/pull/139474 >From b4814ba942266c5d4f4f070cbdef7b721738f33e Mon Sep 17 00:00:00 2001 From: Andrey Davydov Date: Sun, 11 May 2025 22:23:38 +0200 Subject: [PATCH] [clang-tidy] false positive narrowing conversion Let's conside

[clang] [Clang] Consider default template arguments when synthesizing CTAD guides (PR #147675)

2025-07-13 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/147675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 040e7ad - [Clang] Consider default template arguments when synthesizing CTAD guides (#147675)

2025-07-13 Thread via cfe-commits
Author: Younan Zhang Date: 2025-07-14T14:45:23+08:00 New Revision: 040e7ad8281dcb52507070fbeec59421af78c5ca URL: https://github.com/llvm/llvm-project/commit/040e7ad8281dcb52507070fbeec59421af78c5ca DIFF: https://github.com/llvm/llvm-project/commit/040e7ad8281dcb52507070fbeec59421af78c5ca.diff

[clang] [Clang] Consider default template arguments when synthesizing CTAD guides (PR #147675)

2025-07-13 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/147675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Consider default template arguments when synthesizing CTAD guides (PR #147675)

2025-07-13 Thread Younan Zhang via cfe-commits
@@ -1061,15 +1061,36 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef, SmallVector DeduceResults( F->getTemplateParameters()->size()); + // We don't have to deduce against the alias template specialization, + // if the source template is a synthesized alias deduction

[clang] [Clang] Consider default template arguments when synthesizing CTAD guides (PR #147675)

2025-07-13 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/147675 >From f8b1894ad39560edb5bb0c14194a3a2d54a911ff Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 9 Jul 2025 16:29:45 +0800 Subject: [PATCH 1/4] [Clang] Consider default template arguments when synthesizing

[clang] [llvm] [llvm] Change `fp128` lowering to use `f128` functions by default (PR #76558)

2025-07-13 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 edited https://github.com/llvm/llvm-project/pull/76558 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-13 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/147832 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] a6494a3 - [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (#147832)

2025-07-13 Thread via cfe-commits
Author: Finn Plummer Date: 2025-07-13T22:22:46-07:00 New Revision: a6494a3bbf0620ec472d44db4e79c4c508618a61 URL: https://github.com/llvm/llvm-project/commit/a6494a3bbf0620ec472d44db4e79c4c508618a61 DIFF: https://github.com/llvm/llvm-project/commit/a6494a3bbf0620ec472d44db4e79c4c508618a61.diff

[clang] [llvm] [RISCV] Add Andes XAndesBFHCvt (Andes Scalar BFLOAT16) extension (PR #148563)

2025-07-13 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions c,cpp -- clang/test/Driver/print-supported-extensions-riscv.

[clang] [llvm] [RISCV] Add Andes XAndesBFHCvt (Andes Scalar BFLOAT16) extension (PR #148563)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jim Lin (tclin914) Changes The spec can be found at: https://github.com/andestech/andes-v5-isa/releases/tag/ast-v5_4_0-release. The extension includes only two instructions: one for converting from f32 to f16, and another for converting f

[clang] [llvm] [RISCV] Add Andes XAndesBFHCvt (Andes Scalar BFLOAT16) extension (PR #148563)

2025-07-13 Thread Jim Lin via cfe-commits
https://github.com/tclin914 created https://github.com/llvm/llvm-project/pull/148563 The spec can be found at: https://github.com/andestech/andes-v5-isa/releases/tag/ast-v5_4_0-release. The extension includes only two instructions: one for converting from f32 to f16, and another for converting

[clang] 03c540e - [RISCV] Move intrinsic tests for Xsfvcp to sifive-intrinsics sub-directory. NFC.

2025-07-13 Thread Jim Lin via cfe-commits
Author: Jim Lin Date: 2025-07-14T13:08:40+08:00 New Revision: 03c540e360ee5b9ca3e8df95e4a4b17c2bdb7e6f URL: https://github.com/llvm/llvm-project/commit/03c540e360ee5b9ca3e8df95e4a4b17c2bdb7e6f DIFF: https://github.com/llvm/llvm-project/commit/03c540e360ee5b9ca3e8df95e4a4b17c2bdb7e6f.diff LOG:

[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)

2025-07-13 Thread Owen Pan via cfe-commits
owenca wrote: IIRC, we had so many issues with ``AlignArrayOfStructures`` that at one point we were discussing whether to disable it. Even after @mydeveloperday had reduced its functionality to only handling rectangular arrays, we still had to fix quite a few bugs including crashes before it w

[clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-13 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/147832 >From 02e7ad8a92e01b19d85f9bedf831aac161439ccb Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 9 Jul 2025 21:21:53 + Subject: [PATCH 1/3] [HLSL][RootSignature] Implement multiple diagnostics in `Root

[clang] b79c763 - [clang-format][NFC] Simplify some logic in BreakableLineCommentSection (#148324)

2025-07-13 Thread via cfe-commits
Author: Owen Pan Date: 2025-07-13T20:35:45-07:00 New Revision: b79c763e91ac5e0991eea004b2c4117c8c766718 URL: https://github.com/llvm/llvm-project/commit/b79c763e91ac5e0991eea004b2c4117c8c766718 DIFF: https://github.com/llvm/llvm-project/commit/b79c763e91ac5e0991eea004b2c4117c8c766718.diff LOG:

[clang] [clang-format][NFC] Simplify some logic in BreakableLineCommentSection (PR #148324)

2025-07-13 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/148324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Simplify some logic in BreakableLineCommentSection (PR #148324)

2025-07-13 Thread Owen Pan via cfe-commits
@@ -927,14 +927,12 @@ BreakableLineCommentSection::BreakableLineCommentSection( } if (Lines[i].size() != IndentPrefix.size()) { -PrefixSpaceChange[i] = FirstLineSpaceChange; +assert(Lines[i].size() > IndentPrefix.size()); -if (SpacesInPref

[clang] [clang] Fix a crash when dynamic_cast-ing to a `final` class (PR #148088)

2025-07-13 Thread Oliver Hunt via cfe-commits
@@ -2341,8 +2341,15 @@ llvm::Value *CodeGenFunction::EmitDynamicCast(Address ThisAddr, } else if (IsExact) { // If the destination type is effectively final, this pointer points to the // right type if and only if its vptr has the right value. -Value = CGM.getCXX

[clang] [clang] Diagnose [[nodiscard]] return types in Objective-C++ (PR #142541)

2025-07-13 Thread via cfe-commits
halbi2 wrote: @Sirraide can you please examine and tell if this is what you meant? It is not a template but it is moved into the base class `Expr` now. https://github.com/llvm/llvm-project/pull/142541 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang] Diagnose [[nodiscard]] return types in Objective-C++ (PR #142541)

2025-07-13 Thread via cfe-commits
https://github.com/halbi2 updated https://github.com/llvm/llvm-project/pull/142541 >From c683b2aa84cba1b7057592e50c542cd5645adde5 Mon Sep 17 00:00:00 2001 From: halbi2 Date: Mon, 26 May 2025 15:35:13 -0400 Subject: [PATCH 1/5] [clang] [test] More coverage of [[nodiscard]] --- clang/test/SemaC

[clang] Make -funwind-tables the default for SystemZ. (PR #139764)

2025-07-13 Thread Fangrui Song via cfe-commits
MaskRay wrote: This PR actually enables `-fasynchronous-unwind-tables` instead of `-funwind-tables`. `-fasynchronous-unwind-tables` and `-funwind-tables` control different boolean values. When both are enabled, `-fasynchronous-unwind-tables` takes precedence. https://github.com/llvm/llvm-pro

[clang] [clang] Fix isConstantInitializer handling of transparent init lists. (PR #148030)

2025-07-13 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic closed https://github.com/llvm/llvm-project/pull/148030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cffe7cb - [clang] Fix isConstantInitializer handling of transparent init lists. (#148030)

2025-07-13 Thread via cfe-commits
Author: Eli Friedman Date: 2025-07-13T16:02:52-07:00 New Revision: cffe7cb745a1d18508b620c5e6d339fe51b8f9bf URL: https://github.com/llvm/llvm-project/commit/cffe7cb745a1d18508b620c5e6d339fe51b8f9bf DIFF: https://github.com/llvm/llvm-project/commit/cffe7cb745a1d18508b620c5e6d339fe51b8f9bf.diff

[clang] [clang] Fix isConstantInitializer handling of transparent init lists. (PR #148030)

2025-07-13 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic updated https://github.com/llvm/llvm-project/pull/148030 >From 5c279209bff277e008866e5d5e5192cf99cdcf8d Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 10 Jul 2025 11:37:50 -0700 Subject: [PATCH 1/2] [clang] Fix isConstantInitializer handling of transpare

[clang] Make -funwind-tables the default for SystemZ. (PR #139764)

2025-07-13 Thread via cfe-commits
https://github.com/anoopkg6 updated https://github.com/llvm/llvm-project/pull/139764 >From e0b15d83e04aebc8f7198af085c6fbe35f5ca7d4 Mon Sep 17 00:00:00 2001 From: anoopkg6 Date: Tue, 13 May 2025 18:33:15 +0200 Subject: [PATCH] Make -funwind-tables the default for SystemZ. --- clang/lib/Driver

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: IMO, we should implicitly use `multiprocessing.cpu_count()` in `run-clang-tidy` and `clang-tidy-diff` and use that number if user didn't specify `-j` explicitly. P.S. running lint over all clang-tidy is not so fast now:) ```bash $ time run-clang-tidy -p build/ clang-tools-extra

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Clang-Tidy pull requests are usually small, so is `-j` really necessary? I may say why not to use all cores when we can. If PR only touches 1 file, `clang-tidy-diff` will not load other cores. If PR touches multiple files, the user can have N times faster linting time, which i

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, thank you! https://github.com/llvm/llvm-project/pull/148547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] modernize-use-std-print, format: Fix checks with Abseil functions (PR #142312)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor approved this pull request. LGTM As I understand now, `IgnoreImplicitAsWritten` does not skip `CXXConstructExpr` and other similar nodes but `IgnoreUnlessSpelledInSource` does. To drill down to the `StringLiteral` we need to use `IgnoreUnlessSpelledInSource`. https:/

[clang] [Clang] Do not emit -Wmissing-noreturn when [[noreturn]] is present (PR #148552)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Corentin Jabot (cor3ntin) Changes Fix a false positve warning which was introduced by #146234. --- Full diff: https://github.com/llvm/llvm-project/pull/148552.diff 2 Files Affected: - (modified) clang/lib/Sema/SemaDeclAttr.cpp (+1-1) -

[clang] [clang] [Sema] Suggest [[noreturn]] for void functions that always throw (PR #146234)

2025-07-13 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: I opened #148552 https://github.com/llvm/llvm-project/pull/146234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Do not emit -Wmissing-noreturn when [[noreturn]] is present (PR #148552)

2025-07-13 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/148552 Fix a false positve warning which was introduced by #146234. >From 97211f696179361a2d64d533aa727e3ec1d00b53 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 14 Jul 2025 00:13:52 +0200 Subject: [PATCH]

[clang] Thread Safety Analysis: Compare values of literals (PR #148551)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Puchert (aaronpuchert) Changes The typical case for literals is an array of mutexes, where we want to distinguish `mutex[0]` from `mutex[1]` and so on. Currently they're treated as the same expression, in fact all literals are treat

[clang] Thread Safety Analysis: Compare values of literals (PR #148551)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: Aaron Puchert (aaronpuchert) Changes The typical case for literals is an array of mutexes, where we want to distinguish `mutex[0]` from `mutex[1]` and so on. Currently they're treated as the same expression, in fact all literals

[clang] Thread Safety Analysis: Compare values of literals (PR #148551)

2025-07-13 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert created https://github.com/llvm/llvm-project/pull/148551 The typical case for literals is an array of mutexes, where we want to distinguish `mutex[0]` from `mutex[1]` and so on. Currently they're treated as the same expression, in fact all literals are treated a

[clang] bfb686b - Thread Safety Analysis: Move opcode comparison to Comparator (NFC)

2025-07-13 Thread Aaron Puchert via cfe-commits
Author: Aaron Puchert Date: 2025-07-14T00:10:15+02:00 New Revision: bfb686bb5ba503e9386dc899e1ebbe2488e6a0a8 URL: https://github.com/llvm/llvm-project/commit/bfb686bb5ba503e9386dc899e1ebbe2488e6a0a8 DIFF: https://github.com/llvm/llvm-project/commit/bfb686bb5ba503e9386dc899e1ebbe2488e6a0a8.diff

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread via cfe-commits
EugeneZelenko wrote: Clang-Tidy pull requests are usually small, so is `-j` really necessary? https://github.com/llvm/llvm-project/pull/148547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang] [Sema] Suggest [[noreturn]] for void functions that always throw (PR #146234)

2025-07-13 Thread Martin Hořeňovský via cfe-commits
horenmar wrote: It is not just templates. I just got warning on this code ```cpp namespace { [[noreturn]] void this_throws() { throw std::runtime_error("Some msg"); } void this_doesnt_throw() {} } ``` ``` [92/468] Building CXX object tests/ExtraTests/CMakeFiles/Prefixe

[clang] [clang] [Sema] Suggest [[noreturn]] for void functions that always throw (PR #146234)

2025-07-13 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: This fails for templates https://compiler-explorer.com/z/x6a8G13Ms Presumably because of #37650 @snarang181 @erichkeane https://github.com/llvm/llvm-project/pull/146234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang-tools-extra] [clang-tidy][NFC] Enable 'performance-move-const-arg' in '.clang-tidy' config (PR #148549)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy @llvm/pr-subscribers-clang-tools-extra Author: Baranov Victor (vbvictor) Changes Set `performance-move-const-arg.CheckTriviallyCopyableMove` option to `false` because "trivially copyable" is too strict and give warning for e.g. `MixData` cla

[clang-tools-extra] [clang-tidy][NFC] Enable 'performance-move-const-arg' in '.clang-tidy' config (PR #148549)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/148549 Set `performance-move-const-arg.CheckTriviallyCopyableMove` option to `false` because "trivially copyable" is too strict and give warning for e.g. `MixData` class: https://github.com/llvm/llvm-project/blob/1f

[clang] [clang-format] Add MacrosSkippedByRemoveParentheses option (PR #148345)

2025-07-13 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/148345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c384ec4 - [clang-format] Add MacrosSkippedByRemoveParentheses option (#148345)

2025-07-13 Thread via cfe-commits
Author: Owen Pan Date: 2025-07-13T14:29:51-07:00 New Revision: c384ec431dd7f771c9dd7c462cec5301ac0f32bb URL: https://github.com/llvm/llvm-project/commit/c384ec431dd7f771c9dd7c462cec5301ac0f32bb DIFF: https://github.com/llvm/llvm-project/commit/c384ec431dd7f771c9dd7c462cec5301ac0f32bb.diff LOG:

[clang] Thread Safety Analysis: Warn when using negative reentrant capability (PR #141599)

2025-07-13 Thread Aaron Puchert via cfe-commits
aaronpuchert wrote: > My software currently contains a nasty global recursive lock that we hope to > (over a long period of time, likely years) convert to non-recursive. > > In the meantime, and during the refactor, it's helpful to be able to mark > some functions as `EXCLUSIVE_LOCKS_REQUIRED(

[clang] [Clang][Driver] Revise Cygwin ToolChain to call linker directly (PR #147960)

2025-07-13 Thread Martin Storsjö via cfe-commits
@@ -107,3 +110,282 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +static bool getStaticPIE(con

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/148547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread Safety Analysis: Warn when using negative reentrant capability (PR #141599)

2025-07-13 Thread Aaron Puchert via cfe-commits
aaronpuchert wrote: > > On a related note, do we emit `-Wthread-safety-negative` for reentrant > > locks? I don't remember that we carved out an exception for that, and we > > probably should. > > We do - and it's deliberate on my part as I've been trying to indicate that > there might be val

[clang] [Clang][Driver] Revise Cygwin ToolChain to call linker directly (PR #147960)

2025-07-13 Thread Martin Storsjö via cfe-commits
@@ -1504,6 +1506,7 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args, switch (Type) { case ToolChain::CST_Libcxx: CmdArgs.push_back("-lc++"); +CmdArgs.push_back("-lc++abi"); mstorsjo wrote: libc++abi and libc++ have circular dependencies -

[clang-tools-extra] [clang-tidy] Add filtering of check options by enabled checks in '--dump-config' (PR #147142)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/147142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] b56aeba - [clang-tidy] Add filtering of check options by enabled checks in '--dump-config' (#147142)

2025-07-13 Thread via cfe-commits
Author: Baranov Victor Date: 2025-07-13T23:44:30+03:00 New Revision: b56aebaf82f250ac35d18bcb4d4bf6806af91f49 URL: https://github.com/llvm/llvm-project/commit/b56aebaf82f250ac35d18bcb4d4bf6806af91f49 DIFF: https://github.com/llvm/llvm-project/commit/b56aebaf82f250ac35d18bcb4d4bf6806af91f49.diff

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Baranov Victor (vbvictor) Changes Follow up to https://github.com/llvm/llvm-project/pull/147793. Originally suggested in https://github.com/llvm/llvm-project/pull/147793#issuecomment-3059021433 --- Full diff: https://github.c

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Baranov Victor (vbvictor) Changes Follow up to https://github.com/llvm/llvm-project/pull/147793. Originally suggested in https://github.com/llvm/llvm-project/pull/147793#issuecomment-3059021433 --- Full diff: https://github.com/llvm

[clang-tools-extra] [clang-tidy][NFC] Add mention of running 'clang-tidy' on changes in Contributing.rst (PR #148547)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/148547 Follow up to https://github.com/llvm/llvm-project/pull/147793. Originally suggested in https://github.com/llvm/llvm-project/pull/147793#issuecomment-3059021433 >From 9ee0621a78423ee97d2dcafb6b8de35783222b4e M

[clang] Thread Safety Analysis: Warn when using negative reentrant capability (PR #141599)

2025-07-13 Thread Aaron Puchert via cfe-commits
@@ -286,51 +291,76 @@ static bool checkRecordTypeForScopedCapability(Sema &S, QualType Ty) { return checkRecordDeclForAttr(RT->getDecl()); } -static bool checkTypedefTypeForCapability(QualType Ty) { +static std::optional checkTypedefTypeForCapability(QualType Ty) { const

[clang] [Sema] Remove an unnecessary cast (NFC) (PR #148531)

2025-07-13 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/148531 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 0475526 - [Sema] Remove an unnecessary cast (NFC) (#148531)

2025-07-13 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-07-13T13:12:31-07:00 New Revision: 047552600bd9fac5a6ae63d6e4d44cc174cc3da6 URL: https://github.com/llvm/llvm-project/commit/047552600bd9fac5a6ae63d6e4d44cc174cc3da6 DIFF: https://github.com/llvm/llvm-project/commit/047552600bd9fac5a6ae63d6e4d44cc174cc3da6.diff L

[clang] [CIR] Add support for unary operations on bitfield members (PR #148083)

2025-07-13 Thread via cfe-commits
@@ -239,3 +239,51 @@ void set_volatile(V* v) { // OGCG: [[TMP3:%.*]] = and i64 [[TMP2]], -1095216660481 // OGCG: [[TMP4:%.*]] = or i64 [[TMP3]], 12884901888 // OGCG: store volatile i64 [[TMP4]], ptr [[TMP1]], align 4 + +void unOp(S* s) { + s->d++; +} + +// CIR: cir.func

[clang] [clang-format][NFC] Simplify some logic in BreakableLineCommentSection (PR #148324)

2025-07-13 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/148324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Simplify some logic in BreakableLineCommentSection (PR #148324)

2025-07-13 Thread Björn Schäpers via cfe-commits
@@ -927,14 +927,12 @@ BreakableLineCommentSection::BreakableLineCommentSection( } if (Lines[i].size() != IndentPrefix.size()) { -PrefixSpaceChange[i] = FirstLineSpaceChange; +assert(Lines[i].size() > IndentPrefix.size()); -if (SpacesInPref

[clang] [clang-format] Add MacrosSkippedByRemoveParentheses option (PR #148345)

2025-07-13 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/148345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add MacrosSkippedByRemoveParentheses option (PR #148345)

2025-07-13 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/148345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add FunctionLikeMacros option (PR #148345)

2025-07-13 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/148345 >From 3affefb96efe2d2955be66c247276b81d5d1d3a1 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 12 Jul 2025 00:09:49 -0700 Subject: [PATCH 1/2] [clang-format] Add FunctionLikeMacros option This allows RemovePa

[clang] [CIR] Upstream the basic structure of LoweringPrepare pass (PR #148545)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Amr Hesham (AmrDeveloper) Changes Upstream, the basic structure of the LoweringPrepare pass as a prerequisite for other ComplexType PR's https://github.com/llvm/llvm-project/issues/141365 --- Full diff: https://github.com/llvm/llvm-pro

[clang] [CIR] Upstream the basic structure of LoweringPrepare pass (PR #148545)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Amr Hesham (AmrDeveloper) Changes Upstream, the basic structure of the LoweringPrepare pass as a prerequisite for other ComplexType PR's https://github.com/llvm/llvm-project/issues/141365 --- Full diff: https://github.com/llvm/llvm-proje

[clang] [CIR] Upstream the basic structure of LoweringPrepare pass (PR #148545)

2025-07-13 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/148545 Upstream, the basic structure of the LoweringPrepare pass as a prerequisite for other ComplexType PR's https://github.com/llvm/llvm-project/issues/141365 >From 46579b053f7f0a95d11a06406b25e04a5ba3806f Mon

[clang] [CIR] Upstream ComplexImagPtrOp for ComplexType (PR #144236)

2025-07-13 Thread Amr Hesham via cfe-commits
@@ -1775,6 +1775,44 @@ OpFoldResult cir::ComplexCreateOp::fold(FoldAdaptor adaptor) { return cir::ConstComplexAttr::get(realAttr, imagAttr); } +//===--===// AmrDeveloper wrote: I am not su

[clang] [clang-format] Add FunctionLikeMacros option (PR #148345)

2025-07-13 Thread Björn Schäpers via cfe-commits
@@ -2786,6 +2786,11 @@ struct FormatStyle { /// \version 3.7 std::vector ForEachMacros; + /// A vector of function-like macros whose invocations should be skipped by + /// ``RemoveParentheses``. + /// \version 21 + std::vector FunctionLikeMacros; Hazar

[clang] [Sema] Remove an unnecessary cast (NFC) (PR #148531)

2025-07-13 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/148531 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Reland "[clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr for use-integer-sign-comparison" (PR #144240)

2025-07-13 Thread Julian Schmidt via cfe-commits
@@ -121,3 +121,100 @@ int AllComparisons() { return 0; } + +namespace PR127471 { +int getSignedValue(); +unsigned int getUnsignedValue(); + +void callExprTest() { + +if (getSignedValue() < getUnsignedValue()) +return; +// CHECK-MESSAGES: :[[

[clang] [clang][RISCV] Always pass & return flexible array member structs indirectly. (PR #148541)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Owen Anderson (resistor) Changes This fixes an issue reported in https://github.com/llvm/llvm-project/issues/148536 where writes to flexible array members would sometimes be lost if the struct happened t

[clang] [clang][RISCV] Always pass & return flexible array member structs indirectly. (PR #148541)

2025-07-13 Thread Owen Anderson via cfe-commits
https://github.com/resistor created https://github.com/llvm/llvm-project/pull/148541 This fixes an issue reported in https://github.com/llvm/llvm-project/issues/148536 where writes to flexible array members would sometimes be lost if the struct happened to hit one of the cases where it would b

[clang] [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (PR #147832)

2025-07-13 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/147832 >From 02e7ad8a92e01b19d85f9bedf831aac161439ccb Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 9 Jul 2025 21:21:53 + Subject: [PATCH 1/3] [HLSL][RootSignature] Implement multiple diagnostics in `Root

[clang] [HLSL][RootSignature] Add basic parameter validations of Root Elements (PR #145795)

2025-07-13 Thread Finn Plummer via cfe-commits
https://github.com/inbelic closed https://github.com/llvm/llvm-project/pull/145795 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7ccdc59 - [HLSL][RootSignature] Add basic parameter validations of Root Elements (#145795)

2025-07-13 Thread via cfe-commits
Author: Finn Plummer Date: 2025-07-13T10:23:38-07:00 New Revision: 7ccdc595f8ecca0bc477c3e17683c52dca440845 URL: https://github.com/llvm/llvm-project/commit/7ccdc595f8ecca0bc477c3e17683c52dca440845 DIFF: https://github.com/llvm/llvm-project/commit/7ccdc595f8ecca0bc477c3e17683c52dca440845.diff

[clang] [clang][NFC] Add header comment for OSLog.cpp (PR #148537)

2025-07-13 Thread Bogdan Vetrenko via cfe-commits
https://github.com/bv2k4 updated https://github.com/llvm/llvm-project/pull/148537 >From 5da384406e5e5b0c435bba81ae3d93059560fb69 Mon Sep 17 00:00:00 2001 From: Bogdan Vetrenko Date: Sun, 13 Jul 2025 19:37:43 +0300 Subject: [PATCH] [clang][NFC] Add header comment for OSLog.cpp Signed-off-by: Bo

[clang] [clang][NFC] Add header comment for OSLog.cpp (PR #148537)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Bogdan Vetrenko (bv2k4) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/148537.diff 1 Files Affected: - (modified) clang/lib/AST/OSLog.cpp (+15-3) ``diff diff --git a/clang/lib/AST/OSLog.cpp b/clang/lib/AST/

[clang] [clang][NFC] Add header comment for OSLog.cpp (PR #148537)

2025-07-13 Thread Bogdan Vetrenko via cfe-commits
https://github.com/bv2k4 created https://github.com/llvm/llvm-project/pull/148537 None >From f2b29fa668d3d07bb52f45590c833eeaa13f928b Mon Sep 17 00:00:00 2001 From: Bogdan Vetrenko Date: Sun, 13 Jul 2025 19:37:43 +0300 Subject: [PATCH] [clang][NFC] Add header comment for OSLog.cpp Signed-off-

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: Buildbot failure seems unrelated https://github.com/llvm/llvm-project/pull/146830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Simplify some logic in BreakableLineCommentSection (PR #148324)

2025-07-13 Thread Owen Pan via cfe-commits
@@ -927,14 +927,12 @@ BreakableLineCommentSection::BreakableLineCommentSection( } if (Lines[i].size() != IndentPrefix.size()) { -PrefixSpaceChange[i] = FirstLineSpaceChange; +assert(Lines[i].size() > IndentPrefix.size()); -if (SpacesInPref

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-13 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `premerge-monolithic-linux` running on `premerge-linux-1` while building `clang-tools-extra` at step 7 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/379

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-13 Thread via cfe-commits
github-actions[bot] wrote: @localspook Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a bui

[clang-tools-extra] [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (PR #146830)

2025-07-13 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/146830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 59b39c0 - [clang-tidy] Add new check: `readability-use-concise-preprocessor-directives` (#146830)

2025-07-13 Thread via cfe-commits
Author: Victor Chernyakin Date: 2025-07-13T19:23:27+03:00 New Revision: 59b39c0031eded7c46e554b161382187cb2d0ca5 URL: https://github.com/llvm/llvm-project/commit/59b39c0031eded7c46e554b161382187cb2d0ca5 DIFF: https://github.com/llvm/llvm-project/commit/59b39c0031eded7c46e554b161382187cb2d0ca5.d

[clang] [clang-tools-extra] [clang-tidy] `bugprone-unchecked-optional-access`: handle `BloombergLP::bdlb:NullableValue::makeValue` to prevent false-positives (PR #144313)

2025-07-13 Thread Baranov Victor via cfe-commits
vbvictor wrote: Analysis reviewers, could you please take a look at this https://github.com/llvm/llvm-project/pull/144313#discussion_r2188585118. Your opinion is highly appreciated! https://github.com/llvm/llvm-project/pull/144313 ___ cfe-commits mai

[clang] [clang-tools-extra] [clang-tidy] `bugprone-unchecked-optional-access`: handle `BloombergLP::bdlb:NullableValue::makeValue` to prevent false-positives (PR #144313)

2025-07-13 Thread Baranov Victor via cfe-commits
@@ -985,6 +985,20 @@ auto buildTransferMatchSwitch() { isOptionalMemberCallWithNameMatcher(hasName("isNull")), transferOptionalIsNullCall) + // NullableValue::makeValue, NullableValue::makeValueInplace + // Only NullableValue has these methods, bu

[clang] [Sema] Remove an unnecessary cast (NFC) (PR #148531)

2025-07-13 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes Dtor is already of CXXDestructorDecl *. --- Full diff: https://github.com/llvm/llvm-project/pull/148531.diff 1 Files Affected: - (modified) clang/lib/Sema/SemaExprCXX.cpp (+1-2) ``diff di

[clang] [Sema] Remove an unnecessary cast (NFC) (PR #148531)

2025-07-13 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/148531 Dtor is already of CXXDestructorDecl *. >From eb40382c6e61acfb95afcf72a968dea1f4629b2a Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 12 Jul 2025 16:05:38 -0700 Subject: [PATCH] [Sema] Remove an

[clang] [Clang][P1061] Fix template arguments in local classes (PR #121225)

2025-07-13 Thread Matheus Izvekov via cfe-commits
@@ -4433,8 +4433,12 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation, // No need to instantiate in-class initializers during explicit // instantiation. if (Field->hasInClassInitializer() && TSK == TSK_ImplicitInstantiation) { +// H

  1   2   >