llvm/llvm-project

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

Open

#187.675 aperta il 20 mar 2026

Vedi su GitHub
 (8 commenti) (1 reazione) (0 assegnatari)C++ (10.782 fork)batch import
clang:temporal-safetygood first issue

Metriche repository

Star
 (26.378 star)
Metriche merge PR
 (Merge medio 1g 2h) (1000 PR mergiate in 30 g)

Descrizione

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
};

Guida contributor