[clang] Reland: [clang][test] add testing for the AST matcher reference (PR #112168)

2024-11-15 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti closed https://github.com/llvm/llvm-project/pull/112168 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread Simon Pilgrim via cfe-commits
@@ -723,3 +723,9 @@ not within the bounds of the input vectors; index of -1 found at position 0 is n permitted in a constexpr context}} vector4charConst1, vector4charConst2, -1, -1, -1, -1); + +static_assert(__builtin_reduce_add((vector4char){}) == 0);

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread via cfe-commits
https://github.com/c8ef updated https://github.com/llvm/llvm-project/pull/116243 >From b2f4d35d33684381648ef6662cf9f943b90e146e Mon Sep 17 00:00:00 2001 From: c8ef Date: Thu, 14 Nov 2024 15:11:00 + Subject: [PATCH 1/3] constexpr reduce_add --- clang/docs/ReleaseNotes.rst |

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
@@ -3229,6 +3230,52 @@ void Sema::CheckArgAlignment(SourceLocation Loc, NamedDecl *FDecl, << ParamName << (FDecl != nullptr) << FDecl; } +void Sema::checkLifetimeCaptureBy(FunctionDecl *FD, bool IsMemberFunction, + const Expr *ThisArg,

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
@@ -3229,6 +3230,52 @@ void Sema::CheckArgAlignment(SourceLocation Loc, NamedDecl *FDecl, << ParamName << (FDecl != nullptr) << FDecl; } +void Sema::checkLifetimeCaptureBy(FunctionDecl *FD, bool IsMemberFunction, + const Expr *ThisArg,

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
@@ -1411,18 +1437,34 @@ static void checkExprLifetimeImpl(Sema &SemaRef, // warnings or errors on inner temporaries within this one's initializer. return false; }; - usx95 wrote: Done. https://github.com/llvm/llvm-project/pull/115921 ___

[clang] [Clang] Fix name lookup for dependent bases (PR #114978)

2024-11-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian commented: I don't think this patch fixes the following case: ```cpp template struct A { struct B { using X = int; struct C { using X = void; struct D; }; }; }; template struct A::B::C::D : B

[clang] [clang][SME] Ignore flatten for callees mismatched streaming attributes (PR #116391)

2024-11-15 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/116391 If `__attribute__((flatten))` is used on a function don't inline any callees with incompatible streaming attributes. Without this check, clang may produce incorrect code when `flatten` is used in code with strea

[clang] [clang] Instantiate attributes on LabelDecls (PR #115924)

2024-11-15 Thread Eric Astor via cfe-commits
https://github.com/ericastor updated https://github.com/llvm/llvm-project/pull/115924 >From da2e66a6a2636bf1a1ab2e25afdbd29095b6db3f Mon Sep 17 00:00:00 2001 From: Eric Astor Date: Tue, 12 Nov 2024 17:37:42 + Subject: [PATCH 1/7] [clang] Instantiate attributes on other decl types Start pro

[clang] [clang] Instantiate attributes on LabelDecls (PR #115924)

2024-11-15 Thread Eric Astor via cfe-commits
https://github.com/ericastor updated https://github.com/llvm/llvm-project/pull/115924 >From da2e66a6a2636bf1a1ab2e25afdbd29095b6db3f Mon Sep 17 00:00:00 2001 From: Eric Astor Date: Tue, 12 Nov 2024 17:37:42 + Subject: [PATCH 1/7] [clang] Instantiate attributes on other decl types Start pro

[clang] [clang] Instantiate attributes on LabelDecls (PR #115924)

2024-11-15 Thread Eric Astor via cfe-commits
ericastor wrote: > test needs some simplification/help, else this is fine. Thanks, I was mimicking another file that apparently isn't following best practices. Done! https://github.com/llvm/llvm-project/pull/115924 ___ cfe-commits mailing list cfe-co

[clang] [clang][SME] Ignore flatten for callees with mismatched streaming attributes (PR #116391)

2024-11-15 Thread Benjamin Maxwell via cfe-commits
https://github.com/MacDue edited https://github.com/llvm/llvm-project/pull/116391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/115168 >From 5ca48e03412b1b8e9253f13356b9cc957f6fd9e5 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Nov 2024 17:58:43 +0300 Subject: [PATCH 1/8] Add EvalASTMutator interface with `InstantiateFunctionD

[clang] [clang] Instantiate attributes on LabelDecls (PR #115924)

2024-11-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Test seems to have disappeared entirely! https://github.com/llvm/llvm-project/pull/115924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix constexpr-ness on implicitly deleted destructors (PR #116359)

2024-11-15 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/116359 >From c950170822a58ca98e3f50e95b160c83ec1c63f1 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 15 Nov 2024 21:49:23 +0800 Subject: [PATCH] [Clang] Fix constexpr-ness on implicitly deleted destructor

[clang] [Clang] Fix constexpr-ness on implicitly deleted destructors (PR #116359)

2024-11-15 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/116359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [NFC] Merge two ifs to a single one (PR #116226)

2024-11-15 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/116226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix constexpr-ness on implicitly deleted destructors (PR #116359)

2024-11-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: A. Jiang (frederick-vs-ja) Changes In C++20, a defaulted but implicitly deleted destructor is constexpr if and only if the class has no virtual base class. This hasn't been changed in C++23 by P2448R2. Constexpr-ness on a deleted destruc

[clang] [SYCL] change sycl version accrodnig to standard (PR #114790)

2024-11-15 Thread via cfe-commits
dklochkov-emb wrote: Ping @bader Could you recommend who can be added as a reviewer to these changes? https://github.com/llvm/llvm-project/pull/114790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Erich Keane via cfe-commits
@@ -17,10 +17,10 @@ E get_e(); // cxx11-warning@-1 {{use of the 'nodiscard' attribute is a C++17 extension}} void f() { - get_s(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + get_s(); // expected-warning {{ignoring return

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
@@ -3951,7 +3958,7 @@ The capturing entity ``X`` can be one of the following: std::set s; }; -- 'global', 'unknown' (without quotes). +- `global`, `unknown`. usx95 wrote: We would give an error: 'lifetime_capture_by' attribute argument "global" is n

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
@@ -3983,6 +3990,21 @@ The attribute supports specifying more than one capturing entities: s2.insert(a); } +Currently clang would diagnose when a temporary is used as an argument to a usx95 wrote: Done. https://github.com/llvm/llvm-project/pull/115921

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
@@ -3925,13 +3925,20 @@ def LifetimeCaptureByDocs : Documentation { parameter or implicit object parameter indicates that that objects that are referred to by that parameter may also be referred to by the capturing entity ``X``. -By default, a reference is considered to refer

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
@@ -3925,13 +3925,20 @@ def LifetimeCaptureByDocs : Documentation { parameter or implicit object parameter indicates that that objects that are referred to usx95 wrote: Done. https://github.com/llvm/llvm-project/pull/115921

[clang] Revert "[analyzer][Solver] Early return if sym is concrete on assuming" (PR #116362)

2024-11-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/116362 Reverts llvm/llvm-project#115579 This introduced a breakage: https://lab.llvm.org/buildbot/#/builders/46/builds/7928 >From 42c0948d6102cf3f5a7baad52db5e16aaf5eacc8 Mon Sep 17 00:00:00 2001 From: Balazs Benics

[clang] 8d43c88 - Revert "[analyzer][Solver] Early return if sym is concrete on assuming" (#116362)

2024-11-15 Thread via cfe-commits
Author: Balazs Benics Date: 2024-11-15T10:28:40+01:00 New Revision: 8d43c880a5be1cd624052eb009d1f3983d4c5459 URL: https://github.com/llvm/llvm-project/commit/8d43c880a5be1cd624052eb009d1f3983d4c5459 DIFF: https://github.com/llvm/llvm-project/commit/8d43c880a5be1cd624052eb009d1f3983d4c5459.diff

[clang] Revert "[analyzer][Solver] Early return if sym is concrete on assuming" (PR #116362)

2024-11-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/116362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland: [clang][test] add testing for the AST matcher reference (PR #112168)

2024-11-15 Thread Julian Schmidt via cfe-commits
5chmidti wrote: > @5chmidti Sorry for the delay. I have tested this and it seems to compile on > windows msvc without any regressions. Thank you for checking that it works 👍 https://github.com/llvm/llvm-project/pull/112168 ___ cfe-commits mailing li

[clang] Update ClangFormat.rst (PR #109380)

2024-11-15 Thread via cfe-commits
https://github.com/love1angel closed https://github.com/llvm/llvm-project/pull/109380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Enhance modernize-use-starts-ends-with to handle substr patterns (PR #116033)

2024-11-15 Thread Helmut Januschka via cfe-commits
https://github.com/hjanuschka edited https://github.com/llvm/llvm-project/pull/116033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 0dfae06 - [analyzer] Trigger copy event when copying empty structs (3/4) (#115918)

2024-11-15 Thread via cfe-commits
Author: Balazs Benics Date: 2024-11-15T10:55:22+01:00 New Revision: 0dfae0676014ca961fa404fd40d609f58d935b63 URL: https://github.com/llvm/llvm-project/commit/0dfae0676014ca961fa404fd40d609f58d935b63 DIFF: https://github.com/llvm/llvm-project/commit/0dfae0676014ca961fa404fd40d609f58d935b63.diff

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon edited https://github.com/llvm/llvm-project/pull/116243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread Simon Pilgrim via cfe-commits
@@ -13528,6 +13528,20 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, return Success(DidOverflow, E); } + case Builtin::BI__builtin_reduce_add: { +APValue Source; +if (!EvaluateAsRValue(Info, E->getArg(0), Source)) + return false; + +

[clang] [Clang] Fix constexpr-ness on implicitly deleted destructors (PR #116359)

2024-11-15 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/116359 >From b93d63fff0b5a3b7e77c2ecfffe69830c0802e76 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 15 Nov 2024 18:20:26 +0800 Subject: [PATCH] [Clang] Fix constexpr-ness on implicitly deleted destructor

[clang] [NFC][Clang][AArch64]Refactor implementation of Neon vectors MFloat8… (PR #114804)

2024-11-15 Thread via cfe-commits
https://github.com/CarolineConcatto updated https://github.com/llvm/llvm-project/pull/114804 >From fc97e36c08964c42debda9ad1a289d15b5327d23 Mon Sep 17 00:00:00 2001 From: Caroline Concatto Date: Wed, 30 Oct 2024 16:20:16 + Subject: [PATCH] [NFC][Clang][AArch64]Refactor implementation of Neo

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
@@ -793,3 +806,202 @@ void test13() { } } // namespace GH100526 + +namespace lifetime_capture_by { +struct X { + const int *x; + void captureInt(const int& x [[clang::lifetime_capture_by(this)]]) { this->x = &x; } + void captureSV(std::string_view sv [[clang::lifetime_capt

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon commented: This seems reasonable to me - I'd recommend you take a look at the min/max reductions to see if signed/unsigned can be correctly handled with this approach. https://github.com/llvm/llvm-project/pull/116243 ___ cf

[clang] [ARM] Fix NaN behaviour for MVE compare intrinsics (PR #116371)

2024-11-15 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/116371 The MVE intrinsics are defined as having the same behaviour as the instructions which they correspond to. In particular, the vcmpleq and vcmpltq intrinsics correspond to the VCMP instruction with the LE or LT

[clang] [ARM] Fix NaN behaviour for MVE compare intrinsics (PR #116371)

2024-11-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-arm Author: Oliver Stannard (ostannard) Changes The MVE intrinsics are defined as having the same behaviour as the instructions which they correspond to. In particular, the vcmpleq and vcmpltq intrinsics correspond to the VCMP instruction with

[clang] [clang][ASTImporter] Allow import of similar friend template with different depth (PR #115734)

2024-11-15 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/115734 From eca94b1ff721d8ec857a5fdee8b358ce22d210aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 11 Nov 2024 16:53:59 +0100 Subject: [PATCH 1/2] [clang][ASTImporter] Allow import of s

[clang] [clang][ASTImporter] Allow import of similar friend template with different depth (PR #115734)

2024-11-15 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/115734 From eca94b1ff721d8ec857a5fdee8b358ce22d210aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 11 Nov 2024 16:53:59 +0100 Subject: [PATCH] [clang][ASTImporter] Allow import of simil

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-15 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 469f9d5fb8fcfe7dc42baa2daa7e230147f234de ff328f256824e30b2c3c8db184a0fcafaef32637 --e

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/116374 This is a follow up to #112015 and it reduces the unnecessary duplication of source locations further. We do not need to allocate source location space in the serialized PCMs for module maps used only to

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread via cfe-commits
@@ -13528,6 +13528,20 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, return Success(DidOverflow, E); } + case Builtin::BI__builtin_reduce_add: { +APValue Source; +if (!EvaluateAsRValue(Info, E->getArg(0), Source)) + return false; + +

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread via cfe-commits
https://github.com/c8ef updated https://github.com/llvm/llvm-project/pull/116243 >From b2f4d35d33684381648ef6662cf9f943b90e146e Mon Sep 17 00:00:00 2001 From: c8ef Date: Thu, 14 Nov 2024 15:11:00 + Subject: [PATCH 1/2] constexpr reduce_add --- clang/docs/ReleaseNotes.rst |

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Yihe Li via cfe-commits
https://github.com/Mick235711 updated https://github.com/llvm/llvm-project/pull/112521 >From 59f7dbdd8eed456b76e93f6260bf0e361242e9fd Mon Sep 17 00:00:00 2001 From: Yihe Li Date: Wed, 16 Oct 2024 18:53:04 +0800 Subject: [PATCH 1/2] [clang] Improve diagnostic on [[nodiscard]] attribute --- cla

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread via cfe-commits
@@ -723,3 +723,9 @@ not within the bounds of the input vectors; index of -1 found at position 0 is n permitted in a constexpr context}} vector4charConst1, vector4charConst2, -1, -1, -1, -1); + +static_assert(__builtin_reduce_add((vector4char){}) == 0);

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread via cfe-commits
c8ef wrote: > This seems reasonable to me - I'd recommend you take a look at the min/max > reductions to see if signed/unsigned can be correctly handled with this > approach. Thank you for your suggestions! Signed integer overflow in C++ is undefined behavior and cannot occur in a constexpr c

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -3983,6 +3990,21 @@ The attribute supports specifying more than one capturing entities: s2.insert(a); } +Currently clang would diagnose when a temporary is used as an argument to a bricknerb wrote: Nit: Use "Clang" and not "clang" when referring to

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -3925,13 +3925,20 @@ def LifetimeCaptureByDocs : Documentation { parameter or implicit object parameter indicates that that objects that are referred to bricknerb wrote: While you're here, remove one of the "that" ? https://github.com/llvm/llvm-project/pull

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -1460,7 +1502,15 @@ void checkExprLifetime(Sema &SemaRef, const AssignedEntity &Entity, checkExprLifetimeImpl(SemaRef, /*InitEntity=*/nullptr, /*ExtendingEntity=*/nullptr, LK_Assignment, &Entity, -Init); +

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -0,0 +1,220 @@ +// RUN: %clang_cc1 --std=c++20 -fsyntax-only -Wdangling -Wdangling-field -Wreturn-stack-address -verify %s + +#include "Inputs/lifetime-analysis.h" + +struct X { + const int *x; + void captureInt(const int& x [[clang::lifetime_capture_by(this)]]) { this->x =

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
https://github.com/bricknerb requested changes to this pull request. https://github.com/llvm/llvm-project/pull/115921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fa5a10d - [clang] [NFC] Merge two ifs to a single one (#116226)

2024-11-15 Thread via cfe-commits
Author: Boaz Brickner Date: 2024-11-15T15:09:44+01:00 New Revision: fa5a10d6313e94795739c79eb3c0774d5f8e3461 URL: https://github.com/llvm/llvm-project/commit/fa5a10d6313e94795739c79eb3c0774d5f8e3461 DIFF: https://github.com/llvm/llvm-project/commit/fa5a10d6313e94795739c79eb3c0774d5f8e3461.diff

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -3229,6 +3230,52 @@ void Sema::CheckArgAlignment(SourceLocation Loc, NamedDecl *FDecl, << ParamName << (FDecl != nullptr) << FDecl; } +void Sema::checkLifetimeCaptureBy(FunctionDecl *FD, bool IsMemberFunction, + const Expr *ThisArg,

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -0,0 +1,220 @@ +// RUN: %clang_cc1 --std=c++20 -fsyntax-only -Wdangling -Wdangling-field -Wreturn-stack-address -verify %s + +#include "Inputs/lifetime-analysis.h" + +struct X { + const int *x; + void captureInt(const int& x [[clang::lifetime_capture_by(this)]]) { this->x =

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -3229,6 +3230,52 @@ void Sema::CheckArgAlignment(SourceLocation Loc, NamedDecl *FDecl, << ParamName << (FDecl != nullptr) << FDecl; } +void Sema::checkLifetimeCaptureBy(FunctionDecl *FD, bool IsMemberFunction, + const Expr *ThisArg,

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -3925,13 +3925,20 @@ def LifetimeCaptureByDocs : Documentation { parameter or implicit object parameter indicates that that objects that are referred to by that parameter may also be referred to by the capturing entity ``X``. -By default, a reference is considered to refer

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -3951,7 +3958,7 @@ The capturing entity ``X`` can be one of the following: std::set s; }; -- 'global', 'unknown' (without quotes). +- `global`, `unknown`. bricknerb wrote: What happens when the parameters are named "global" or "unknown"? https:/

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -3925,13 +3925,20 @@ def LifetimeCaptureByDocs : Documentation { parameter or implicit object parameter indicates that that objects that are referred to by that parameter may also be referred to by the capturing entity ``X``. -By default, a reference is considered to refer

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -0,0 +1,220 @@ +// RUN: %clang_cc1 --std=c++20 -fsyntax-only -Wdangling -Wdangling-field -Wreturn-stack-address -verify %s + +#include "Inputs/lifetime-analysis.h" bricknerb wrote: Perhaps let's split the test file that checks the capture-by on the standard

[clang] [clang] Instantiate attributes on LabelDecls (PR #115924)

2024-11-15 Thread Erich Keane via cfe-commits
@@ -1,4 +1,64 @@ -// RUN: %clang_cc1 -std=gnu++20 -fsyntax-only -verify %s +// RUN: split-file %s %t +// RUN: %clang_cc1 -std=gnu++20 -fsyntax-only -ast-dump -verify %t/good_annotate.cpp | FileCheck %s erichkeane wrote: This looks like it should just be a separa

[clang] [clang] Instantiate attributes on LabelDecls (PR #115924)

2024-11-15 Thread Erich Keane via cfe-commits
@@ -1,4 +1,64 @@ -// RUN: %clang_cc1 -std=gnu++20 -fsyntax-only -verify %s +// RUN: split-file %s %t +// RUN: %clang_cc1 -std=gnu++20 -fsyntax-only -ast-dump -verify %t/good_annotate.cpp | FileCheck %s +// RUN: %clang_cc1 -std=gnu++20 -fsyntax-only -verify %t/bad_annotate.cpp +//

[clang] [clang] Instantiate attributes on LabelDecls (PR #115924)

2024-11-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: test needs some simplification/help, else this is fine. https://github.com/llvm/llvm-project/pull/115924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -3229,6 +3230,52 @@ void Sema::CheckArgAlignment(SourceLocation Loc, NamedDecl *FDecl, << ParamName << (FDecl != nullptr) << FDecl; } +void Sema::checkLifetimeCaptureBy(FunctionDecl *FD, bool IsMemberFunction, + const Expr *ThisArg,

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -0,0 +1,220 @@ +// RUN: %clang_cc1 --std=c++20 -fsyntax-only -Wdangling -Wdangling-field -Wreturn-stack-address -verify %s + +#include "Inputs/lifetime-analysis.h" + +struct X { + const int *x; + void captureInt(const int& x [[clang::lifetime_capture_by(this)]]) { this->x =

[clang] [clang] Instantiate attributes on LabelDecls (PR #115924)

2024-11-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/115924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [NFC] Merge two ifs to a single one (PR #116226)

2024-11-15 Thread Boaz Brickner via cfe-commits
https://github.com/bricknerb closed https://github.com/llvm/llvm-project/pull/116226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove device override for operator new when the C++ standard >= 26 (PR #114056)

2024-11-15 Thread Ognyan Mirev via cfe-commits
OgnianM wrote: Ping https://github.com/llvm/llvm-project/pull/114056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -1110,13 +1117,14 @@ static bool shouldRunGSLAssignmentAnalysis(const Sema &SemaRef, isAssignmentOperatorLifetimeBound(Entity.AssignmentOperator))); } -static void checkExprLifetimeImpl(Sema &SemaRef, - const InitializedEntity *I

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -0,0 +1,220 @@ +// RUN: %clang_cc1 --std=c++20 -fsyntax-only -Wdangling -Wdangling-field -Wreturn-stack-address -verify %s + +#include "Inputs/lifetime-analysis.h" + +struct X { + const int *x; + void captureInt(const int& x [[clang::lifetime_capture_by(this)]]) { this->x =

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -3229,6 +3230,52 @@ void Sema::CheckArgAlignment(SourceLocation Loc, NamedDecl *FDecl, << ParamName << (FDecl != nullptr) << FDecl; } +void Sema::checkLifetimeCaptureBy(FunctionDecl *FD, bool IsMemberFunction, + const Expr *ThisArg,

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/112521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This seems reasonable, I have 3 comments, which are a request to release note that we're changing the preference here, plus some improvements to the diagnostic. https://github.com/llvm/llvm-project/pull/112521 ___

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Erich Keane via cfe-commits
@@ -17,10 +17,10 @@ E get_e(); // cxx11-warning@-1 {{use of the 'nodiscard' attribute is a C++17 extension}} void f() { - get_s(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + get_s(); // expected-warning {{ignoring return

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Erich Keane via cfe-commits
@@ -1616,22 +1616,24 @@ QualType CallExpr::getCallReturnType(const ASTContext &Ctx) const { return FnType->getReturnType(); } -const Attr *CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const { +std::pair +CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const { +

[clang] [llvm] [Driver][SYCL] Add initial SYCL offload compilation support (PR #107493)

2024-11-15 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-darwin` running on `doug-worker-3` while building `clang,llvm` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/4847 Here is

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Erich Keane via cfe-commits
@@ -9300,6 +9300,12 @@ def warn_unused_container_subscript_expr : Warning< def warn_unused_call : Warning< "ignoring return value of function declared with %0 attribute">, InGroup; +def warn_unused_return_type : Warning< + "ignoring %select{return value|temporary}0 of type

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Yihe Li via cfe-commits
@@ -17,10 +17,10 @@ E get_e(); // cxx11-warning@-1 {{use of the 'nodiscard' attribute is a C++17 extension}} void f() { - get_s(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} + get_s(); // expected-warning {{ignoring return

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
@@ -1420,9 +1446,18 @@ static void checkExprLifetimeImpl(Sema &SemaRef, ? IndirectLocalPathEntry::LifetimeBoundCall : IndirectLocalPathEntry::GslPointerAssignment, Init}); + } else if (LK == LK_LifetimeCapture) { usx95 wrote:

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/115921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Yihe Li via cfe-commits
@@ -1616,22 +1616,24 @@ QualType CallExpr::getCallReturnType(const ASTContext &Ctx) const { return FnType->getReturnType(); } -const Attr *CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const { +std::pair +CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const { +

[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

2024-11-15 Thread Boaz Brickner via cfe-commits
@@ -1411,18 +1437,34 @@ static void checkExprLifetimeImpl(Sema &SemaRef, // warnings or errors on inner temporaries within this one's initializer. return false; }; - bricknerb wrote: Bring back the blank line after the visitor definition. https://gi

[clang-tools-extra] [clang-tidy] fix bugprone-sizeof-expression when sizeof expression with template types (PR #115275)

2024-11-15 Thread via cfe-commits
@@ -175,7 +175,8 @@ Changes in existing checks - Improved :doc:`bugprone-sizeof-expression ` check to find suspicious usages of ``sizeof()``, ``alignof()``, and ``offsetof()`` when adding or - subtracting from a pointer directly or when used to scale a numeric value. + su

[clang] [llvm] [Driver][SYCL] Add initial SYCL offload compilation support (PR #107493)

2024-11-15 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `clang,llvm` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/11

[clang] [clang] Handle trivial_abi attribute for Microsoft ABI. (PR #88857)

2024-11-15 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Yeah. It's still on my list to update the patch to be recursive - but it's > been a pretty busy period and I haven't gotten around to it yet. Excellent! Nothing is on fire here, so whenever you get around to it, that's great. :-) https://github.com/llvm/llvm-project/pull

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/116374 >From ff328f256824e30b2c3c8db184a0fcafaef32637 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Fri, 15 Nov 2024 11:18:21 +0100 Subject: [PATCH 1/2] [ASTWriter] Do not allocate source location space for

[clang] [ASTWriter] Do not allocate source location space for module maps used only for textual headers (PR #116374)

2024-11-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/116374 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix constexpr-ness on implicitly deleted destructors (PR #116359)

2024-11-15 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/116359 >From f39b5a01c0c98ff9270a1c47c1c3915688d8b359 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 15 Nov 2024 19:35:11 +0800 Subject: [PATCH] [Clang] Fix constexpr-ness on implicitly deleted destructor

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but can you also add a release note to `clang/docs/ReleaseNotes.rst` letting users know about the new restriction and why. https://github.com/llvm/llvm-project/pull/115991 ___ cfe-commit

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-15 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s AaronBallman wrote: ```suggestion // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s ``` https://github.com/llvm/llvm-project/pull/115991 ___

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/115991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-11-15 Thread Yihe Li via cfe-commits
Mick235711 wrote: Gentle ping @erichkeane https://github.com/llvm/llvm-project/pull/112521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][Solver] Early return if sym is concrete on assuming (PR #115579)

2024-11-15 Thread Ding Fei via cfe-commits
danix800 wrote: > @danix800 Could you please have a look at the failed test, such that we could > reapply this PR? I reverted this soon after I realized the broken test is > from this PR. Working on it! https://github.com/llvm/llvm-project/pull/115579 _

[clang] [analyzer] Print the callee name in CallEnter in exploded-graph-rewriter (PR #116225)

2024-11-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/116225 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9cbf2dd - [analyzer] Print the callee name in CallEnter in exploded-graph-rewriter (#116225)

2024-11-15 Thread via cfe-commits
Author: Balazs Benics Date: 2024-11-15T14:21:35+01:00 New Revision: 9cbf2dd6f3900045f1bbbdf44142f572d8f3b339 URL: https://github.com/llvm/llvm-project/commit/9cbf2dd6f3900045f1bbbdf44142f572d8f3b339 DIFF: https://github.com/llvm/llvm-project/commit/9cbf2dd6f3900045f1bbbdf44142f572d8f3b339.diff

[clang] [Clang] Fix name lookup for dependent bases (PR #114978)

2024-11-15 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Please wait for a week before pinging someone again. I think this is fine to merge as is, if you want to go ahead. We can always do post commit review later. https://github.com/llvm/llvm-project/pull/114978 ___ cfe-commits mailing lis

[clang] [analyzer] Print the PostInitializer target in exploded-graph-rewriter (PR #116034)

2024-11-15 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/116034 >From b815854d4b96651b483a28010b59adb889c44dbc Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Wed, 13 Nov 2024 12:55:06 +0100 Subject: [PATCH] [analyzer] Print the PostInitializer target in exploded-graph-

[clang] [analyzer] [MallocChecker] Less aggressive analysis of functions (PR #116383)

2024-11-15 Thread via cfe-commits
https://github.com/likeamahoney created https://github.com/llvm/llvm-project/pull/116383 It seems to me that the `unix.Malloc` checker is too aggressive when it comes to analyzing function arguments. For example it warns on such code (there is no directly usage of freed memory - but just poin

[clang] [analyzer] [MallocChecker] Less aggressive analysis of functions (PR #116383)

2024-11-15 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

<    1   2   3   4   5   >