https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88175
--- Comment #4 from Jonny Grant <jg at jguk dot org> --- Also, it is "copy" that is unused uninitialized? (not "temp") The line carat is also incorrect I believe, it should be header.cpp:10:12 ? So would be better if it was as follows: =============================================== $ g++ -O2 -Werror=uninitialized -o header header.cpp header.cpp: In function ‘void test(info_t)’: header.cpp:10:12: error: ‘copy.info::registered’ is used uninitialized in this function [-Werror=uninitialized] temp = copy; ~~~~~^~~~~~ cc1plus: some warnings being treated as errors