hokein wrote:
> We're seeing some -Wdangling-assignment warnings after this change, and they
> all seem to be false positives so far: https://crbug.com/350808950 It's not a
> huge deal if there are just a few, but figured it's worth mentioning.
Thanks for the report. That's interesting. Techni
zmodem wrote:
We're seeing some -Wdangling-assignment warnings after this change, and they
all seem to be false positives so far: https://crbug.com/350808950 It's not a
huge deal if there are just a few, but figured it's worth mentioning.
https://github.com/llvm/llvm-project/pull/96475
___
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun approved this pull request.
https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -964,17 +966,34 @@ static bool
pathOnlyInitializesGslPointer(IndirectLocalPath &Path) {
return false;
}
-void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,
+void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity,
Xazax-hu
@@ -964,17 +966,34 @@ static bool
pathOnlyInitializesGslPointer(IndirectLocalPath &Path) {
return false;
}
-void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,
+void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity,
hokein w
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/96475
>From 97d1b80680112c3fa271501427a18273aed61dbe Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Mon, 24 Jun 2024 10:58:53 +0200
Subject: [PATCH 1/4] [clang] Extend the existing lifetimebound check for
assignments.
https://github.com/usx95 approved this pull request.
Thanks. LGTM.
https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -964,17 +966,34 @@ static bool
pathOnlyInitializesGslPointer(IndirectLocalPath &Path) {
return false;
}
-void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,
+void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity,
Xazax-hu
https://github.com/Xazax-hun approved this pull request.
LGTM, with a nit.
https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hokein wrote:
> You can also add "Fixes: #54492" to description to close this bug as this
> only asks for pointer type support
>
> Please also add release notes.
Done.
https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/96475
>From 97d1b80680112c3fa271501427a18273aed61dbe Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Mon, 24 Jun 2024 10:58:53 +0200
Subject: [PATCH 1/3] [clang] Extend the existing lifetimebound check for
assignments.
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1053,16 +1072,23 @@ void checkExprLifetime(Sema &SemaRef, const
InitializedEntity &Entity,
if (pathContainsInit(Path))
return false;
-SemaRef.Diag(DiagLoc, diag::warn_dangling_variable)
-<< RK << !Entity.getParent()
-<< Ex
@@ -964,11 +966,26 @@ static bool
pathOnlyInitializesGslPointer(IndirectLocalPath &Path) {
return false;
}
-void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,
+void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity,
E
https://github.com/hokein commented:
thanks for the review.
https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -40,6 +40,12 @@ namespace usage_ok {
int *p = A().class_member(); // expected-warning {{temporary whose address
is used as value of local variable 'p' will be destroyed at the end of the
full-expression}}
int *q = A(); // expected-warning {{temporary whose address is us
@@ -964,11 +966,26 @@ static bool
pathOnlyInitializesGslPointer(IndirectLocalPath &Path) {
return false;
}
-void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,
+void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity,
E
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hokein updated
https://github.com/llvm/llvm-project/pull/96475
>From 97d1b80680112c3fa271501427a18273aed61dbe Mon Sep 17 00:00:00 2001
From: Haojian Wu
Date: Mon, 24 Jun 2024 10:58:53 +0200
Subject: [PATCH 1/2] [clang] Extend the existing lifetimebound check for
assignments.
@@ -1028,6 +1045,7 @@ void checkExprLifetime(Sema &SemaRef, const
InitializedEntity &Entity,
switch (shouldLifetimeExtendThroughPath(Path)) {
case PathLifetimeKind::Extend:
+assert(InitEntity && "Expect only on initializing the entity");
u
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/usx95 commented:
You can also add "Fixes: https://github.com/llvm/llvm-project/issues/54492"; to
description to close this bug as this only asks for pointer type support
Please also add release notes.
https://github.com/llvm/llvm-project/pull/96475
__
@@ -964,11 +966,26 @@ static bool
pathOnlyInitializesGslPointer(IndirectLocalPath &Path) {
return false;
}
-void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,
+void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity,
E
@@ -1053,16 +1072,23 @@ void checkExprLifetime(Sema &SemaRef, const
InitializedEntity &Entity,
if (pathContainsInit(Path))
return false;
-SemaRef.Diag(DiagLoc, diag::warn_dangling_variable)
-<< RK << !Entity.getParent()
-<< Ex
@@ -40,6 +40,12 @@ namespace usage_ok {
int *p = A().class_member(); // expected-warning {{temporary whose address
is used as value of local variable 'p' will be destroyed at the end of the
full-expression}}
int *q = A(); // expected-warning {{temporary whose address is us
https://github.com/Xazax-hun edited
https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -964,11 +966,26 @@ static bool
pathOnlyInitializesGslPointer(IndirectLocalPath &Path) {
return false;
}
-void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,
+void checkExprLifetime(Sema &SemaRef, const CheckingEntity &CEntity,
E
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Xazax-hun wrote:
+1, I like Ilya's suggestion.
https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ilya-biryukov wrote:
@hokein could you please split this into two PRs, one with an NFC change and
another one with adding assignment support?
GitHub is not great at providing the UI to review individual commits and we
won't be able to merge as 2 separate commits with the green button (which see
Xazax-hun wrote:
Wow, this is awesome! Thanks for tackling this!
https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Haojian Wu (hokein)
Changes
The lifetime bound warning in Clang currently only considers initializations.
This patch extends the warning to include assignments.
- **NFC refactoring (first commit)**: this moves the existing lifetime checki
35 matches
Mail list logo