================
@@ -1091,21 +1104,22 @@ static bool
isAssignmentOperatorLifetimeBound(CXXMethodDecl *CMD) {
}
static bool shouldRunGSLAssignmentAnalysis(const Sema &SemaRef,
- const AssignedEntity &Entity) {
+ const CapturingEntity &Entity) {
bool EnableGSLAssignmentWarnings = !SemaRef.getDiagnostics().isIgnored(
diag::warn_dangling_lifetime_pointer_assignment, SourceLocation());
return (EnableGSLAssignmentWarnings &&
- (isRecordWithAttr<PointerAttr>(Entity.LHS->getType()) ||
+ (isRecordWithAttr<PointerAttr>(Entity.Expression->getType()) ||
isAssignmentOperatorLifetimeBound(Entity.AssignmentOperator)));
}
static void checkExprLifetimeImpl(Sema &SemaRef,
----------------
bricknerb wrote:
IIUC, this function handles different use cases and for different use cases it
needs different args to be set.
Since it's becoming more complex with this change, would it make sense to split
it to different functions and only reuse the shared logic between the different
use cases?
I think this could simplify the asserts and make the calling this method much
clearer and safer.
https://github.com/llvm/llvm-project/pull/111499
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits