warning: leak of ‘ptr [-Wanalyzer-malloc-leak]
Function test
File ../../src/gcc/testsuite/g++.dg/analyzer/exception-leak-1.C
Line 7
Column 9
7 throw 42; // { dg-warning "leak of 'ptr'" }
^~
int test()
int test(): events 1-3
5 void *ptr = __builtin_malloc (1024); // { dg-message "allocated here" }
~~~~~~~~~~~~~~~~~^~~~~~
|
(1) allocated here
6
7 throw 42; // { dg-warning "leak of 'ptr'" }
~~
|
(2) throwing exception of type ‘int’ here...
(3) ⚠️ ‘ptr’ leaks here; was allocated at (1)