https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115536
--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> --- Created attachment 58488 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58488&action=edit Proposed fix Here is a proposed fix. When in a const expression the fix creates marked boolean constvars which are resolved to TRUE and FALSE in the respective control flow paths. The basic block and constant resolving is applied on the current scope and one path will be removed (with the unused assignment). When outside a const expression a temporary boolean variable is created.