https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115313
--- Comment #1 from Jeremy R. <llvm at rifkin dot dev> ---
Reduced:
#include <string>
std::string foo() {
std::string str;
return str;
}
<source>: In function 'std::string foo()':
<source>:4:17: warning: use of uninitialized value '<unknown>' [CWE-457]
[-Wanalyzer-use-of-uninitialized-value]
4 | std::string str;
| ^~~
'std::string foo()': events 1-3
|
| 3 | std::string foo() {
| | ^~~
| | |
| | (1) region created on stack here
| | (2) capacity: 8 bytes
| 4 | std::string str;
| | ~~~
| | |
| | (3) use of uninitialized value '<unknown>' here
|