Issue 169758
Summary [LifetimeSafety] False-positive for aliases to reference variable
Labels false-positive, clang:temporal-safety
Assignees usx95
Reporter usx95
    https://godbolt.org/z/GEvfvxvG6

```cpp
#include <iostream>
#include <string>
#include <string_view>
#include <vector>

void foo() {
    std::vector<std::string> v;
 std::string_view view;
    for (const auto& s : v) {
        view = s; // warning: 's' does not live long enough.
    }
    (void)view; // note: later used here.
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to