https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106922
--- Comment #18 from Jan Žižka <jan.zizka at nokia dot com> --- Created attachment 53617 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53617&action=edit Third reproducer failing with 9baee6181b4e427e0b5ba417e51424c15858dce7 I did cherry-pick 9baee6181b4e427e0b5ba417e51424c15858dce7 on top of 5edf02ed2b6de024f83a023d046a6a18f645bc83 and gcc 12 and I confirm that the second reproducer works with this. But unfortunately our production code still fails. Sorry that I cannot provide better more reliable reproducer, but our production code is complex and I try to bump it to smallest snippet which still fails. I can try to refactor our production code somehow to remove all proprietary stuff but that might take some time. I have created new reproducer, this time it fails both with boost::optional and with std::optional. In the reproducer I have commented lines which will cause the warning to disappear when removed. There is additional int in the structure which needs to be there and also the assignment needs to be repeated in the loop.