I confirmed your 2nd attempt was the fix. After reverting: https://cgit.freedesktop.org/libreoffice/core/commit/?id=4f13f8dd the error came back. The workaround code is ugly. If you're certain the logic is the same, you want to revert it and disable the warning TODO to enable them with future compiler? Here is an example: https://cgit.freedesktop.org/libreoffice/core/commit/?id=232622051966faa116e7093d5c0df26e44cddb43