-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:temporal-safetyIssue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)Issue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)regression
Description
All usages are dangling references below:
#include <set>
#include <unordered_set>
#include <vector>
void sets() {
auto x = std::set<int>{}.find(1);
auto y = std::set<int>{}.begin();
auto z = std::set<int>{}.end();
}
void sets2() {
auto x = std::unordered_set<int>{}.find(1);
auto y = std::unordered_set<int>{}.begin();
auto z = std::unordered_set<int>{}.end();
}
void vector() {
auto y2 = std::vector<int>{}.begin(); // Only warning here. Good!
}https://godbolt.org/z/Mb4vr31P4
We might be missing [[clang::lifetimebound]] on these methods.
cc: @hokein
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:temporal-safetyIssue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)Issue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)regression
Type
Projects
Status
No status