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. }
Runtime error #stdin #stdout 0.01s 2808KB
stdin
Standard input is empty
stdout

Standard output is empty