-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
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)
Description
#include <string>
void foo(bool cond) {
std::string* res;
{
std::string a = "a";
std::string b = "b";
res = cond ? &a : &b;
res = &(cond ? a : b);
}
(void)*res;
}
void bar(bool cond) {
std::string* res;
{
std::string a = "a";
std::string b = "b";
std::string* p = &a;
std::string* q = &b;
res = cond ? p : q;
}
(void)*res;
}
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)
Type
Projects
Status
No status