leak of ‘ptr [-Wanalyzer-malloc-leak]
7 do_something (); // { dg-message "if 'void do_something\\(\\)' throws an exception\.\.\." }
~~~~~~~~~~~~~^~
int test()
int test(): events 1-3
5 void *ptr = __builtin_malloc (1024); // { dg-message "allocated here" }
~~~~~~~~~~~~~~~~~^~~~~~
|
(1) allocated here
6
7 do_something (); // { dg-message "if 'void do_something\\(\\)' throws an exception\.\.\." }
~~~~~~~~~~~~~~~
|
(2) if ‘void do_something()’ throws an exception...
(3) ⚠️ ‘ptr’ leaks here; was allocated at (1)