llvm/llvm-project

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

開放

#187,675 建立於 2026年3月20日

 (8 則留言) (1 個反應) (0 位負責人)C++ (10,782 個分叉)batch import
clang:temporal-safetygood first issue

倉庫指標

星標
 (26,378 顆星)
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
};

貢獻者指南