[clang] [clang] Emit -Wdangling diagnoses for cases where a gsl-pointer is construct from a gsl-owner object in a container. (PR #104556)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 16 01:32:36 PDT 2024


hokein wrote:

Testing it a bit more, unfortunately, it has a false positive on the following case:

```
const char* kk() {
    std::optional<string_view> k;
    return k.value().data(); // dangling warning, but we should not diagnose it.
}
```

https://github.com/llvm/llvm-project/pull/104556


More information about the cfe-commits mailing list