https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72826
--- Comment #2 from Zack Weinberg <zackw at panix dot com> --- I can persuade it to print instead test2.cc:6:9: warning: ‘timer.countdownTimer::started’ is used uninitialized in this function [-Wuninitialized] by using -O1 instead of -O2 or by removing the line `started = true;` I suspect that -O1 turns off ESRA and removing the write makes it not replace the variable. While we're here, it is also misidentifying the function where the problem is: test2.cc: In function ‘int main()’: That should be "In function ‘countdownTimer::countdownTimer’". I presume the problem here is inlining.