RP
Size: a a a
RP
SK
e
p
RP
#include <memory>
using namespace std;
int* example_2_5_6_6a() { // pset(ret) = {static}
int i = 0;
return &i; // pset(&i) = {i}, then KILL(i) -> pset(ret) = {invalid}
// ERROR, {invalid} is not substitutable for {static}
}
e
RP
R
RP
<source>:6:5: warning: returning a dangling pointer [-Wlifetime]
return &i;
^~~~~~~~~
<source>:6:5: note: pointee 'i' left the scope here
return &i;
^~~~~~~~~
e
RP
R
RP
RP
R
p
e
R
RP
RP