-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Open
Copy link
Labels
clang: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)false-positiveWarning fires when it should notWarning fires when it should not
Description
#include <stdint.h>
#include <span>
#include <utility>
#include <vector>
void foo() {
std::vector<int> src_data;
std::span<int> src_span;
{
std::vector<int> temp_src_data = {1, 2, 3};
temp_src_data.push_back(12);
src_span = temp_src_data;
// ^~~~~~~~~~~~~
src_data = std::move(temp_src_data);
}
// ^ destroyed here
(void)src_span[0];
// ^~~~~~~~ note: later used here
}Metadata
Metadata
Assignees
Labels
clang: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)false-positiveWarning fires when it should notWarning fires when it should not
Type
Projects
Status
No status