llvm/llvm-project

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

Open

#187 675 ouverte le 20 mars 2026

Voir sur GitHub
 (8 commentaires) (1 réaction) (0 assignés)C++ (10 782 forks)batch import
clang:temporal-safetygood first issue

Métriques du dépôt

Stars
 (26 378 stars)
Métriques de merge PR
 (Merge moyen 1j 2h) (1 000 PRs mergées en 30 j)

Description

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

Guide contributeur