fork download
  1. #include<iostream>
  2. #include<list>
  3. using namespace std;
  4. list<int>& func();
  5.  
  6. int main(){
  7. list<int>& a = func();
  8. delete &a;
  9. std::cout<<"Here\n";
  10. }
  11.  
  12. list<int>& func(){
  13. list<int>* ptr = new list<int>;
  14. return *ptr;
  15. }
Success #stdin #stdout 0.02s 2812KB
stdin
Standard input is empty
stdout
Here