Files
clang-p2996/clang/lib/Sema/CheckExprLifetime.cpp
Haojian Wu f484a04d79 [clang] Suppress a dangling false positive when owner is moved in member initializer. (#114213)
This patch extends the filtering heuristic to apply for the
Lifetimebound code path.

This will suppress a common false positive:

```
namespace std {
template<typename T>
struct unique_ptr {
  T &operator*();
  T *get() const [[clang::lifetimebound]];
};
} // namespace std

struct X {
  X(std::unique_ptr<int> up) :
    pointer(up.get()), owner(std::move(up)) {}

  int *pointer;
  std::unique_ptr<int> owner;
};
```

See #114201.
2024-11-01 13:32:57 +01:00

56 KiB