Skip to content

Suggest [[clang::lifetimebound]] for implicit this parameter #169941

@usx95

Description

@usx95
struct S {
  const S& get() { return *this; }
};

struct T {
  std::string data;
  std::string_view getView() { return data; }
}

Expected suggestions:

const S& get() [[clang::lifetimebound]] { return *this; }
std::string_view getView() [[clang::lifetimebound]] { return data; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:temporal-safetyIssue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions