Skip to content

Add support for view types  #152513

@usx95

Description

@usx95

View-Type Support: Extend the analysis beyond raw pointers to handle common view/span types that act like non-owning references.

std::string_view foo() {
  std::string_view res = a;
  {
    std::string a = "on stack";
    res = a; // warning: does not live long enough.
  }
  std::cout << res;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions