llvm / llvm/llvm-project

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

Open
#187,675 8 comments 1 reaction 0 assignees View on GitHub
clang:temporal-safety good first issue
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.