Issue 181196
Summary [LifetimeSafety] False-positive due to assignments involving std::tie
Labels false-positive, clang:temporal-safety
Assignees
Reporter usx95
    https://godbolt.org/z/q6ToGh779
```cpp
#include <map>
#include <tuple>

int& reproduce(int Key) {
    std::map<int, int> Cache;
    std::map<int, int>::iterator It = Cache.begin();
    bool New;
 std::tie(It, New) = Cache.try_emplace(Key);

    return It->second;
}
```

`std::tie` on LHS should KILL the iterator `It` value and therefore it shouldn't be considered alive at the point of invalidation.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to