llvm/llvm-project

-Wdangling-field detects view members initalized from a by-value owner parameter

Open

#187,675 创建于 2026年3月20日

在 GitHub 查看
 (8 评论) (1 反应) (0 负责人)C++ (10,782 fork)batch import
clang:temporal-safetygood first issue

仓库指标

Star
 (26,378 star)
PR 合并指标
 (平均合并 1天 2小时) (30 天内合并 1,000 个 PR)

描述

struct Foo {};
struct Bar {
  const Foo& foo;
  Bar(Foo f ) : foo(f) {} // good, clang warn on this case
};


struct C {
    string_view s;
    C(std::string c) : s(c) {} // bad, clang doesn't warn on this case. support it
};

贡献者指南