https://github.com/usx95 approved this pull request.
LGTM.
https://github.com/llvm/llvm-project/pull/134228
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/131997
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/131997
>From 9220b14a8147850a39e2c9bdf1188f2135b7a0ae Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 19 Mar 2025 10:25:07 +
Subject: [PATCH 1/3] [clang] Do not infer lifetimebound for functions with
void r
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/131997
>From 9220b14a8147850a39e2c9bdf1188f2135b7a0ae Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 19 Mar 2025 10:25:07 +
Subject: [PATCH 1/2] [clang] Do not infer lifetimebound for functions with
void r
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/131997
>From 9220b14a8147850a39e2c9bdf1188f2135b7a0ae Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 19 Mar 2025 10:25:07 +
Subject: [PATCH 1/2] [clang] Do not infer lifetimebound for functions with
void r
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/131997
>From 9220b14a8147850a39e2c9bdf1188f2135b7a0ae Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 19 Mar 2025 10:25:07 +
Subject: [PATCH] [clang] Do not infer lifetimebound for functions with void
retur
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/131997
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 created
https://github.com/llvm/llvm-project/pull/131997
None
>From 9220b14a8147850a39e2c9bdf1188f2135b7a0ae Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 19 Mar 2025 10:25:07 +
Subject: [PATCH] [clang] Do not infer lifetimebound for functions with void
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/124133
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1239,11 +1239,12 @@ static AnalysisResult analyzePathForGSLPointer(const
IndirectLocalPath &Path,
}
// Check the return type, e.g.
// const GSLOwner& func(const Foo& foo [[clang::lifetimebound]])
+// GSLOwner* func(cosnt Foo& foo [[clang::lifetimebound]
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/127460
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/127460
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/127460
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1239,11 +1239,12 @@ static AnalysisResult analyzePathForGSLPointer(const
IndirectLocalPath &Path,
}
// Check the return type, e.g.
// const GSLOwner& func(const Foo& foo [[clang::lifetimebound]])
+// GSLOwner* func(cosnt Foo& foo [[clang::lifetimebound]
@@ -852,3 +852,27 @@ struct Test {
};
} // namespace GH120543
+
+namespace GH127195 {
+template
+struct StatusOr {
+ T* operator->() [[clang::lifetimebound]];
+ T* value() [[clang::lifetimebound]];
+};
+
+const char* foo() {
+ StatusOr s;
+ return s->data(); // expected-w
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/124133
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/124133
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 6600371b2948e9c0227a1ef0072a8cdf5c983005 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 7 Feb 2025 17:08:56 +
Subject: [PATCH] CFG-based lifetime analysis using existing annotations
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 5f9375e0a9f491952fed8edf1d383e3f6feccdc6 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 7 Feb 2025 17:08:56 +
Subject: [PATCH] CFG-based lifetime analysis using existing annotations
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 52028aeb5acc9a23c21c96d1fe9729031f61a7bc Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 7 Feb 2025 17:08:56 +
Subject: [PATCH] CFG-based lifetime analysis using existing annotations
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From c69aef83bfbb219ba07b578d78919a522569a59a Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 7 Feb 2025 17:08:56 +
Subject: [PATCH] CFG-based lifetime analysis using existing annotations
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From cec28dbf72a389b80bead9e1184d2bc8b1c1e894 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 7 Feb 2025 17:08:56 +
Subject: [PATCH] CFG-based lifetime analysis using existing annotations
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 9076d28fbf8d7ee7042b9301b8b6fc7dc80c0a7b Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 7 Feb 2025 17:08:56 +
Subject: [PATCH] CFG-based lifetime analysis using existing annotations
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From d4ccc6ce7e2b7af1eeb5164f6a1e47f57fe93cd8 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 7 Feb 2025 17:08:56 +
Subject: [PATCH] CFG-based lifetime analysis using existing annotations
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/126039
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/126039
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 created
https://github.com/llvm/llvm-project/pull/126039
None
>From fedb0a7b6d30870a3d7f7c77f8d431fdba3d3a7d Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 6 Feb 2025 09:47:24 +
Subject: [PATCH] [analyzer] Use getFileName and do not use realpath names
--
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/125670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 ready_for_review
https://github.com/llvm/llvm-project/pull/125670
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 created
https://github.com/llvm/llvm-project/pull/125670
[dummy]
>From 6e8a4c942708aa11b0c2a735881b5a368f97580d Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 9 Oct 2024 18:41:19 +
Subject: [PATCH 1/2] [clang] Update string and string_view in lifetimeboun
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/124133
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/3] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/2] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/2] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/124133
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH 1/2] [experimental] Detect return-stack-addr using CFG
---
.../A
https://github.com/usx95 created
https://github.com/llvm/llvm-project/pull/124133
None
>From 22990789b61e9f9d22e88a6b008eb3166fd1cb56 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Thu, 23 Jan 2025 15:47:39 +
Subject: [PATCH] [experimental] Detect return-stack-addr using CFG
---
...
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/122890
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/122890
>From c660f891b2c54c795fea58807be4405710e7a6b0 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 8 Jan 2025 13:42:11 +
Subject: [PATCH 1/3] [clang] Infer capture_by for insert_or_assign
---
clang/lib/
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/122890
>From c660f891b2c54c795fea58807be4405710e7a6b0 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 8 Jan 2025 13:42:11 +
Subject: [PATCH 1/2] [clang] Infer capture_by for insert_or_assign
---
clang/lib/
https://github.com/usx95 created
https://github.com/llvm/llvm-project/pull/122890
None
>From c660f891b2c54c795fea58807be4405710e7a6b0 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 8 Jan 2025 13:42:11 +
Subject: [PATCH 1/2] [clang] Infer capture_by for insert_or_assign
---
clan
https://github.com/usx95 approved this pull request.
Thanks. LGTM.
https://github.com/llvm/llvm-project/pull/122286
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -26,6 +29,17 @@ bool isOverrideMethod(const FunctionDecl *Function) {
return MD->size_overridden_methods() > 0 || MD->hasAttr();
return false;
}
+
+bool hasAttrAfterParam(const SourceManager *SourceManager,
+ const ParmVarDecl *Param) {
+ for (co
@@ -26,6 +29,17 @@ bool isOverrideMethod(const FunctionDecl *Function) {
return MD->size_overridden_methods() > 0 || MD->hasAttr();
return false;
}
+
+bool hasAttrAfterParam(const SourceManager *SourceManager,
+ const ParmVarDecl *Param) {
+ for (co
@@ -1103,6 +1094,8 @@ shouldLifetimeExtendThroughPath(const IndirectLocalPath
&Path) {
for (auto Elem : Path) {
if (Elem.Kind == IndirectLocalPathEntry::DefaultInit)
return PathLifetimeKind::Extend;
+if (Elem.Kind == IndirectLocalPathEntry::MemberExpr)
+ c
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/122088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1103,6 +1094,8 @@ shouldLifetimeExtendThroughPath(const IndirectLocalPath
&Path) {
for (auto Elem : Path) {
if (Elem.Kind == IndirectLocalPathEntry::DefaultInit)
return PathLifetimeKind::Extend;
+if (Elem.Kind == IndirectLocalPathEntry::MemberExpr)
+ c
https://github.com/usx95 approved this pull request.
Thanks. LGTM. Left one comment.
https://github.com/llvm/llvm-project/pull/122088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 approved this pull request.
https://github.com/llvm/llvm-project/pull/122240
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/122109
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/122109
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 created
https://github.com/llvm/llvm-project/pull/122109
None
>From c660f891b2c54c795fea58807be4405710e7a6b0 Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Wed, 8 Jan 2025 13:42:11 +
Subject: [PATCH] [clang] Infer capture_by for insert_or_assign
---
clang/li
@@ -806,3 +806,31 @@ std::string_view test2(int c, std::string_view sv) {
}
} // namespace GH120206
+
+namespace GH120543 {
+struct S {
+ std::string_view sv;
+ std::string s;
+};
+struct Q {
+ const S* get() const [[clang::lifetimebound]];
+};
+void test1() {
+ std::strin
@@ -1103,6 +1094,8 @@ shouldLifetimeExtendThroughPath(const IndirectLocalPath
&Path) {
for (auto Elem : Path) {
if (Elem.Kind == IndirectLocalPathEntry::DefaultInit)
return PathLifetimeKind::Extend;
+if (Elem.Kind == IndirectLocalPathEntry::MemberExpr)
+ c
https://github.com/usx95 approved this pull request.
https://github.com/llvm/llvm-project/pull/118088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -258,9 +258,27 @@ template static bool
isRecordWithAttr(QualType Type) {
auto *RD = Type->getAsCXXRecordDecl();
if (!RD)
return false;
+ // Generally, if a primary template class declaration is annotated with an
+ // attribute, all its specializations generated f
https://github.com/usx95 approved this pull request.
Thanks for quickly addressing this!
https://github.com/llvm/llvm-project/pull/118088
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
@@ -270,34 +270,49 @@ void Sema::inferLifetimeBoundAttribute(FunctionDecl *FD) {
}
void Sema::inferLifetimeCaptureByAttribute(FunctionDecl *FD) {
- if (!FD)
+ auto *MD = dyn_cast_if_present(FD);
+ if (!MD || !MD->getParent()->isInStdNamespace())
return;
- auto *MD = d
https://github.com/usx95 approved this pull request.
Thanks. LGTM.
https://github.com/llvm/llvm-project/pull/118078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/118078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -37,67 +37,56 @@ struct vector {
struct [[gsl::Pointer()]] View {};
std::vector views;
// CHECK: ClassTemplateSpecializationDecl {{.*}} struct vector definition
implicit_instantiation
-// CHECK: TemplateArgument type 'View'
-// CHECK-NOT: LifetimeCaptureByAttr
https://github.com/usx95 approved this pull request.
Can you also add a lit test for:
```cpp
std::vector getVector();
std::set s;
s.insert(getVector().begin(), getVector().end()); // FIXME: taking iterator of
a temporary container without immediate dereference is almost always wrong.
```
https:
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/118013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 commented:
Can you not remove the check-not. It makes sure we are matching all the capture
by attr.
https://github.com/llvm/llvm-project/pull/118001
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.or
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/117315
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/117315
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/117315
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1763,6 +1763,8 @@ class Sema final : public SemaBase {
/// Add [[gsl::Pointer]] attributes for std:: types.
void inferGslPointerAttribute(TypedefNameDecl *TD);
+ static bool isPointerLikeType(QualType QT);
usx95 wrote:
Added comments. Also moved to C
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/8] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/7] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/6] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/5] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/4] [clang] Check specialization for annotation
---
clang/lib/S
@@ -535,6 +535,9 @@ static void visitFunctionCallArguments(IndirectLocalPath
&Path, Expr *Call,
bool EnableGSLAnalysis = !Callee->getASTContext().getDiagnostics().isIgnored(
diag::warn_dangling_lifetime_pointer, SourceLocation());
+ bool EnableDanglingCapture =
+
https://github.com/usx95 approved this pull request.
https://github.com/llvm/llvm-project/pull/117792
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -623,6 +623,26 @@ static void visitFunctionCallArguments(IndirectLocalPath
&Path, Expr *Call,
}
if (CheckCoroCall || Callee->getParamDecl(I)->hasAttr())
VisitLifetimeBoundArg(Callee->getParamDecl(I), Arg);
+else if (const auto *CaptureAttr =
+
@@ -253,9 +253,12 @@ static void
visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path,
LocalVisitor Visit);
template static bool isRecordWithAttr(QualType Type) {
- if (auto *RD = Type->getAsCXXRecordDecl())
-re
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/3] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 updated
https://github.com/llvm/llvm-project/pull/117315
>From e30ae8a6e0c1df8e33c2add6502342cb269c1cfd Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Fri, 22 Nov 2024 11:02:49 +
Subject: [PATCH 1/2] [clang] Check specialization for annotation
---
clang/lib/S
https://github.com/usx95 approved this pull request.
https://github.com/llvm/llvm-project/pull/117733
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
usx95 wrote:
> We could potentially limit the suppression to cases where the destructor is
> trivial, but that might not be worth the added complexity.
I agree that might not be worth the complexity. Let's revisit if we have
practical false positives.
Thanks for the tests. LGTM.
https://gith
@@ -411,3 +411,22 @@ void use() {
}
} // namespace with_span
} // namespace inferred_capture_by
+
+namespace on_constructor {
+struct T {
+ T(const int& t [[clang::lifetime_capture_by(this)]]);
+};
+struct T2 {
+ T2(const int& t [[clang::lifetime_capture_by(x)]], int& x);
+};
@@ -535,6 +535,9 @@ static void visitFunctionCallArguments(IndirectLocalPath
&Path, Expr *Call,
bool EnableGSLAnalysis = !Callee->getASTContext().getDiagnostics().isIgnored(
diag::warn_dangling_lifetime_pointer, SourceLocation());
+ bool EnableDanglingCapture =
+
usx95 wrote:
I considered this during implementation. This is a little controversial.
It is possible that the temporary capturing object uses the captured entity in
its destructor. In principle, we can always detect the order of destructions of
the temporaries and choose to suppress cases when
@@ -961,6 +963,17 @@ static void
visitLocalsRetainedByInitializer(IndirectLocalPath &Path,
if (isa(Init) || isa(Init))
return visitFunctionCallArguments(Path, Init, Visit);
+ if (auto *CPE = dyn_cast(Init)) {
+Path.push_back({IndirectLocalPathEntry::ParenAggInit, C
https://github.com/usx95 approved this pull request.
https://github.com/llvm/llvm-project/pull/117690
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
usx95 wrote:
Wow. This looks quite nice now without the special handling in `NoExtend` case.
Was the missing piece `Path.pop_back();` ?
https://github.com/llvm/llvm-project/pull/117690
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/117690
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,42 @@
+// RUN: %clang_cc1 -verify -std=c++20 %s -fsyntax-only
+
+namespace std {
+template struct remove_reference { typedef T type; };
+template struct remove_reference { typedef T type; };
+template struct remove_reference { typedef T type; };
+
+template typename
@@ -116,6 +116,7 @@ void foo(int n) { // expected-note {{declared here}}
B b2(A(1), {}, 1);
// beforecxx20-warning@-1 {{aggregate initialization of type 'A' from a
parenthesized list of values is a C++20 extension}}
// beforecxx20-warning@-2 {{aggregate initialization of
https://github.com/usx95 closed https://github.com/llvm/llvm-project/pull/117122
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/117122
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7,3 +7,106 @@ struct S {
};
// CHECK: CXXMethodDecl {{.*}}clang::lifetime_capture_by(a, b, global)
+
+//
+// Infer annotation for STL container methods.
+// ***
1 - 100 of 1071 matches
Mail list logo