https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78391
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|msebor at gcc dot gnu.org |unassigned at gcc dot gnu.org Status|ASSIGNED |NEW --- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> --- This has been improved in GCC 12 but GCC still doesn't diagnose the original test case at -O0. It seems that it should be able to, either in the C++ front end or even in the middle end. I'm not working on this anymore.