Skip to content

Don't warn on lifetime_capture annotated method if the class object is a temporary object. #117728

@hokein

Description

@hokein

Example:

struct T{
 void set(const int& t [[clang::lifetime_capture_by(this)]]);
};

void s() {
    T().set(1); // we should not warn on this case.
}

Metadata

Metadata

Assignees

Labels

clang:temporal-safetyIssue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)questionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions